Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm new to Qlikview application development and I need some help on writing an expression.
I was trying to add a second expression where it calculates the % of each cost category as of Premium (Please see the example table below). But I can only get a 100% for the premium line, which is correct, but 0 for the costs. I'm not farmilar with the set analysis so I guess something got messed up there....
Can someone help me with this? Your help is highly appreciated.
Thanks!
Renee
Sum(NET_AMOUNT)/Sum({$<Bar_line={1}>}NET_AMOUNT
)Bar_Line | NET_AMOUNT | % as of Premium |
---|---|---|
1 (represent Premium) | $100 | 100% |
2 (represent Cost1) | $30 | - (should be 30%) |
3 (represent Cost2) | $40 | - (should be 40%) |
You'll need to add the TOTAL qualifier. Try:
Sum(NET_AMOUNT)/Sum( {$<Bar_line={1}>} TOTAL NET_AMOUNT)
You're using Bar_line both as a dimension and in the set modifier. That doesn't work because the set is calulated per chart, not per row. You can fix that in this case by creating a variable vBar1 as =Sum({$<Bar_line={1}>}NET_AMOUNT) and use the variable in the expression: Sum(NET_AMOUNT)/$(vBar1)
Thanks Carlos! This resolves my problem.
Thanks Carlos! This resolves my problem.