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

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
posywang
Creator II
Creator II

How to get privious month-year based on today's date

HI, I am trying to write a script with logic below.

if today is after work day 6 of the calendar month (Oct 9th in this case), make vCurrMth October, otherwise September.

vPrevMth will be the month before vCurrMth.

also, I'd like to add year to the field to make it Month-year and sorted.

my question is if today is 01/02/2018, how to get vCurrMthYear to be Dec 2017 and vPrevMthYear to be Nov 2017?

Many thanks!

0 Replies