Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear all,
in my master data I have 1 row with where I differ the data by either "spot" or "contract".
Depending on this condition I woul like to use a different calculation method (see attached pivot).
On the condition level it looks fine. The total volue however is not correct.
Do you see where my mistake is (I am quite fresh in qlik)?
Many thanks in advance
You need an aggr() to get the sum of all rows within the total. This means:
sum(aggr(YourExpression, Dim1, Dim2))
whereby Dim1 and Dim2 are placeholder for the dimensions in which context the calculation should be executed. In your case surely the spot/contract dimension but probably also the year and month dimension, too.
- Marcus
Hi Arno,
I don't know what is the problem the total is not working. But I see you have more than one dimension, maybe there is a value that can be "OK" for two different dimension, so in the total will be sum twice.
A better solution is create a new field using the condition "IF". Then you only has to sum that field.
You need an aggr() to get the sum of all rows within the total. This means:
sum(aggr(YourExpression, Dim1, Dim2))
whereby Dim1 and Dim2 are placeholder for the dimensions in which context the calculation should be executed. In your case surely the spot/contract dimension but probably also the year and month dimension, too.
- Marcus
Hi Marcus,
this is exactly what I was looking for. Really good solution.
Many thanks and best regards
Arno
Hi Rodri,
thans for your fast feedback. I have already taken the solution offerd by Marcus, and this is fine for my purpose.
I will try your solution later on, too in order to get more familiar with qlik.
Best regards
Arno