Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have 2 date fields & sales field in excel like below
Quarter Month sales
2017Q3 201709 10
2017Q3 201708 20
2017Q3 201707 30
2017Q2 201706 40
2017Q2 201705 50
2017Q2 201704 60
2017Q1 201703 70
2017Q2 201702 80
2017Q2 201701 90
i want to get current quarter sales - (minus) previous quarter based on the quarter selection in front end
if i select 2017Q2 in front end -- it shud show ((40+50+60 = 150) - (70+80+90 = 240)) '-90'
I want "Set Expression" for this..
how to write with functions/variables ? (not hardcoded)
ThankYou!!
Try Below one
vCurrent_Quarter = Quarter={"$(=GetFieldSelections(Quarter))"}
vPrevious_Quarter = Quarter={"$(=GetFieldSelections(Quarter)-1)"}
sum({<$(=vCurrent_Quarterr)>}Sales)- sum({<$(=vPrevious_Quarter)>}Sales)
Hi,
Try This,
Sum({<Quarter={"$(=left(max(PurgeChar(Quarter,'Q')),4)&'Q'&Right(max(PurgeChar(Quarter,'Q')),1))"}>}sales)
-
Sum({<Quarter={"$(=left(max(PurgeChar(Quarter,'Q'))-1,4)&'Q'&Right(max(PurgeChar(Quarter,'Q'))-1,1))"}>}sales)
Regards,
Hi Mohan,
Check this link for similar type of expressions.
https://community.qlik.com/docs/DOC-9144
Hope it helps you.
Regards,
jagan.
Hi Mohan,
I came through your post. This is exactly what I need. Could you please share how to achieve it? The below-shared answers are not working for me. Did you find the right way to do this calculation? I really appreciate any help you can provide?