Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculate Index% from an expression using ValueList?

Hello,

Anyone of you can help me with this please. I have a below expression in a chart which works fine and the Dimensions and Expression show fine without any issues, However

if(ValueList('Pre','Promo','Post','Result')='Pre', num(sum({<TIME_PERIOD_WEEK_NO=p(_WeekPre)>}/ count(_WeekPre)WK_SALES_GROSS_REV),'#,##0'),
if(ValueList('Pre','Promo','Post','Result')='Promo', num(sum({<TIME_PERIOD_WEEK_NO=p(_WeekPromo)>}/count(_WeekPromo) WK_SALES_GROSS_REV),'#,##0'),
if(ValueList('Pre','Promo','Post','Result')='Post', num(sum({<TIME_PERIOD_WEEK_NO=p(_WeekPost)>}/count(_WeekPro) WK_SALES_GROSS_REV),'#,##0'),
num(sum({<TIME_PERIOD_WEEK_NO=p(_WeekPost)>}/Count(_WeekPost) WK_SALES_GROSS_REV) / sum({<TIME_PERIOD_WEEK_NO=p(_WeekPre)>} /Count(_WeekPre) WK_SALES_GROSS_REV) - 1,'#,##0%'))))

in the chart, Now if I want to add another Dimension and column called 'Variance Index %'which is calculated as Post - Pre/ 100 to show in percentage. I was wondering how we can do it, I tried copying the whole expressions for Post and pre and then doing it, also I tried pasting them in variables and using these in the chart, but it doesnt seem to work. Any solution like we use, say if(ValueList(Pre,Post,Promo, Result, Index) = 'Index' 'Pre - Post/100. Please help me with this.

Thanks in Advance

0 Replies