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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Bharathi09
Creator II
Creator II

Dynamic Month

In my application there is a field name called MAX_MONTH_YEAR.It is in format MAY-2022.The data is given up to May month.

When user opens application it must automatically show the previous month

In backend I wrote script for that field as  Date(Floor([MOVE_DATE]), 'MMM-YYYY') as MAX_MONTH_YEAR

I tried using expression  in KPI as   Max(Month(MONTH_YEAR))-1.  But it's not working

Please help me out

Thank you

Labels (1)
1 Reply
salonicdk28
Creator II
Creator II

If your [MOVE_DATE] is in this format DD/MM/YYYY then use the below expression in back end for month year calculation

Date(Date#(Date,'DD/MM/YYYY'),'MMM-YYYY') as MonthYear

Then write this in KPI to get the previous month according to your requirement-

Date(Addmonths(Date#(Max(MonthYear),'MMM-YYYY'),-1),'MMM')

or 

Date(Addmonths(Date#(Max(MonthYear),'MMM-YYYY'),-1),'MMM-YYYY')