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

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