Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a bunch of metrics (left in image below) that I create as expressions and one date dimension (current and previous week) which limits only two dates. How do I get a total/difference column at the end to calculate the difference between the two weeks which is based on a dimension. Column WW is what I want.
Hi John,
I tried your example and it works on simple sum. However, I have percentage calculation and I want to do the difference between the two week percentage. It doesn't work when I use the sum and sign from your example .
OK, back to the previous idea. I've added a Weeks Back field, and used this expression. This might not be exactly what you want, but the idea is to check the column to decide which calculation to perform.
if(Column='W/W',num(sum({<[Weeks Back]={1}>} CSAT)/sum({<[Weeks Back]={2}>} CSAT)-1,'+#,##0%'),num(sum(CSAT),'#,##0'))
Hi John,
You are getting close. However, I want the % calculate for each week and the do the different on the two weeks. See image and Qlikview file where I added another dimension to the raw data.
if(Column='W/W'
,sum({<SL={'SL1'},[Weeks Back]={1}>} CSAT)/sum({<[Weeks Back]={1}>} CSAT)
-sum({<SL={'SL1'},[Weeks Back]={2}>} CSAT)/sum({<[Weeks Back]={2}>} CSAT)
,sum({<SL={'SL1'}>} CSAT)/sum(CSAT))