Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Qlikview expression question: a calculation of another expression

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)$100100%
2 (represent Cost1)$30- (should be 30%)
3 (represent Cost2)$40- (should be 40%)
4 Replies
Not applicable
Author

You'll need to add the TOTAL qualifier. Try:

Sum(NET_AMOUNT)/Sum( {$<Bar_line={1}>} TOTAL NET_AMOUNT)


Gysbert_Wassenaar

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)


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

Thanks Carlos! This resolves my problem.

Anonymous
Not applicable
Author

Thanks Carlos! This resolves my problem.