Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

how to get amount in last 6 months and last 18 months

i am stuck here for calculating data

From last 24 months have to check data with first 6 months and

for last 6 months based on a date column in format(YYYYMMDD) to first 18 months.

Can you anyone please suggest.

51 Replies
Anonymous
Not applicable
Author

Thank you for your help sunny and youusef.

i got it

Shify
Contributor II
Contributor II

The below will work for last 6 months. 

Create 2 variables vMaxMonthYear = max(MonthYear) 

and vMaxMonthYear_6= AddMonths($(vMaxeApplyMonthYear),-6)

where MonthYear has the following format in script MonthStart(YourDate) as MonthYear  

Your measure expression should be as below : 

Sum({<MonthYear={"<=$(=$(vMaxMonthYear)) >=$(=$(vMaxMonthYear_6))" }>}MeasureName)