Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
rizkyramansyah
Contributor
Contributor

How to get VALUE from last MONTH

how to get VALUE from last MONTH ?

this is my script for current MONTH :

if(Uraian = 'FFB Nucleus',sum({< YEAR={$(=max(YEAR))}, LEVEL4 = {"Inti"}, LEVEL3 = {"FFB Purchase"}, WRTTP = {"4"}, MONTH={"=$(=max({<YEAR={$(=max(YEAR))}>} MONTH))"}>}QTY1)
Labels (2)
1 Reply
pradosh_thakur
Master II
Master II

if(Uraian = 'FFB Nucleus',sum({< YEAR={$(=max(YEAR))}, LEVEL4 = {"Inti"}, LEVEL3 = {"FFB Purchase"}, WRTTP = {"4"}, MONTH={"=$(=max({<YEAR={$(=max(YEAR))}>} MONTH)-1)"}>}QTY1)

You may want to check the max(year) part . for situation like this i try to number the month in ascending order . for example lest's say i hav date from dec 2017 till today , so i will assign 1 to dec 207,  to jan 2018 and so on . It will help when calculating previous month as well.

Learning never stops.