Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have a problem with the summation of max values in a column. As you see below, my table has different master spendings and their subbranches. I want to sum the master spendings, in that case only YA.XXXX codes. I've tried some set analysis solutions but they didn't work. When I tried to use aggr() function, I got some results which were not correct. I could use max function for every one of master spendings but my table has so many rows , so that was impossible. If you help me, I would be glad.
Thanks in advance.
Edit:
The formula I use is;
sum(aggr(max([Spendings]),Elements))
In order to achieve that, I generated another field in my script as left(Elements,7) as MasterCode and instead of Elements, I used MasterCode in my "sum(aggr(max([Spendings]),Elements))" formula.
In order to achieve that, I generated another field in my script as left(Elements,7) as MasterCode and instead of Elements, I used MasterCode in my "sum(aggr(max([Spendings]),Elements))" formula.
Not sure I understand right. Your expression looks in right path. Since that doesn't give right result, you could try :
sum(aggr(NODISTINCT max([Spendings]),Elements))
I tried to use left(Elements,7) in the expression and it didn't work but when I used the same expression in the script and saved as another field, that new field worked pretty well in the expression.
Thank you, that is really helpful for my possible applications in qliksense.