Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

calculation of yearmonth value

I have a field 'Period' having YearMonth values like ex. 201312, 201311, 201310....etc

how to calculate 'Current Month -12', 'Current Month -1'(Previous Month)

Hi masters, can you please give a light on this?

2 Replies
Anonymous
Not applicable
Author

Nuthan

First convert it into a Qlikiew date:

     Date ( Date# ( [Period] , 'YYYYMM') )

Then use the AddMonths() function as needed, see the QlikView Desktop help for details.

Best Regards,     Bill

tresesco
MVP
MVP

May be like this?

=MonthName(AddMonths(Date#('201312', 'YYYYMM') ,-1))      // previous month

=MonthName(AddMonths(Date#('201312', 'YYYYMM') ,-12))    // current month -12

Note, Replace the date string with your YearMonth field.