Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
rizkyramansyah
New 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
Honored Contributor II

Re: How to get VALUE from last MONTH

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.