Hi guys, I am trying to calculate last year for my metric in Quicksight calculated field but i keep having inaccurate figures. What i am trying to achieve is:
max(numerator) grouped by months and Vendor for last year
2)sum(denominator) for last year
numerator/denominator
I have done this calculation before for a simple sum of numerator and sum of denominator then i divide the numerator and denominator, but since i am trying to get the max of numerator and sum of denominator before dividing i got wrong figure. e.g
Last year numerator: sumIf(numerator,{end_of_month}>={Last Year} AND {end_of_month}<={Current Year})
Last year denominator: sumIf(denominator,{end_of_month}>={Last Year} AND {end_of_month}<={Current Year})
Full year last year(final calculation): {FY’LY Numerator}/{FY’LY Denominator}
How do i replicate this for my use case?
Hi @ErikG thanks, the other topic was helpful for another problem I was facing, but did not work for this. I tried to map out what i want to achieve in the excel. In the sample data i did in excel, i am trying to get the defect % total. Steps:
sum(numerator)
sum the max(denominator by vendor code and month) denominator at month and vendor code level
numerator/ denominator.
From the topic you referred i couldn’t achieve that.
Hi @WLS-D, you are correct about the Calc2, i have tried it before and it gives the error ‘Mismatched Aggregation’. That the issue i am still facing now
@koflote
The reason why max inside a sumIf doesn’t work is because your condition is evaluated at the row level but the thing that you’re summing is an aggregated value obtained by grouping multiple rows.