Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hello there,
in qlik sense i want sum of amount based on the dimension value.
here's my query -
in this i want sum of amount in table where reference value is either 1,2 or 3 and that sum to be divided by the amount where reference number is 1,2 and 3
required output:
ref sum(amount) above expression
1 10 10/60 = 0.16
2 20 20/60 = 0.33
3 30 30/60 = 0.5
rather the output is showing 1's and zero in that field
please help with this..
i did exactly what he suggested but its not showing those figures and even i tried your expression too
this is what i wrote in that measure:
if(Reference=1 OR Reference=2 OR Reference=3,
sum(Amount) / sum({<Reference={'1','2','3'}>} TOTAL Amount),
if(Reference=5 OR Reference=6 OR Reference=7,
sum(Amount) / sum({<Reference={'5','6','7'}>} TOTAL Amount)
)
)
Not that it should make any difference, but I recommend making your expression a little simpler...
Sum(Amount)/
If(Match(Reference, 1, 2, 3), Sum({<Reference = {'1', '2', '3'}>} TOTAL Amount),
If(Match(Reference, 4, 5, 6), Sum({<Reference = {'4', '5', '6'}>} TOTAL Amount)))
If this still doesn't work, would you be able to share a qvf sample to show what you are doing?
Your question make sense now? Will you provide sample