1 Answer
- Newest
- Most votes
- Most comments
0
My attempt:
- monthTruncDate: truncdate("MM",{billing_period})
- LastMonthSpending: ifelse(dateDiff(monthTruncDate,maxOver(monthTruncDate,[],PRE_AGG), 'MM') = 1, {unblended_cost}, 0)
- LastThreeMonthSpendingAverage: ifelse( dateDiff(monthTruncDate, maxOver(monthTruncDate,[],PRE_AGG), 'MM') = 2, {unblended_cost}, dateDiff(monthTruncDate, maxOver(monthTruncDate,[],PRE_AGG), 'MM') = 3, {unblended_cost}, dateDiff(monthTruncDate, maxOver(monthTruncDate,[],PRE_AGG), 'MM') = 4, {unblended_cost}, 0)/3
I checked against the cost explorer and I think LastMonthSpending value is correct but LastThreeMonthSpendingAverage is slightly off by about 0.7 dollar. Can someone help me check if my approach is correct and scalable? Thank you.
answered a year ago
Relevant content
- asked 9 months ago
- asked 3 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago