Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

gcbm1984
New Contributor

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

Re: Qlikview expression question: a calculation of another expression

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

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


Re: Qlikview expression question: a calculation of another expression

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
gcbm1984
New Contributor

Re: Qlikview expression question: a calculation of another expression

Thanks Carlos! This resolves my problem.

gcbm1984
New Contributor

Re: Qlikview expression question: a calculation of another expression

Thanks Carlos! This resolves my problem.

Community Browser