Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
olramirez
Contributor III
Contributor III

Aggregation with sum and max?

Hello,

i have a report with a variable for expression but the final total is wrong.

Send my report, the final total should be 170,633,792 but this is 2,265,797,212 !!

Please help me.

Olga

1 Solution

Accepted Solutions
sunny_talwar

Change your variable to this

Sum(Aggr(IF(Max({$<Año=, Mes=, MonthYear={'$(=max(MonthYear))'}>}Precio)=0,

        sum(Aggr(Max({$<Año=, Mes=, MonthYear={'$(=max(MonthYear))'}>}Valor),IdFolio)),

        Sum({$<Año=, Mes=, MonthYear={'$(=max(MonthYear))'}>}Valor)

      ), Centro, IdFolio, %FECHA, %ID_ARTICULO))

View solution in original post

2 Replies
sunny_talwar

Change your variable to this

Sum(Aggr(IF(Max({$<Año=, Mes=, MonthYear={'$(=max(MonthYear))'}>}Precio)=0,

        sum(Aggr(Max({$<Año=, Mes=, MonthYear={'$(=max(MonthYear))'}>}Valor),IdFolio)),

        Sum({$<Año=, Mes=, MonthYear={'$(=max(MonthYear))'}>}Valor)

      ), Centro, IdFolio, %FECHA, %ID_ARTICULO))

olramirez
Contributor III
Contributor III
Author

Thanks Sunny