Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
mauvasco62
Contributor III
Contributor III

variable issue

Dear all,

i need your support in order to create a variable.

I try to explain: I turned a date into this format YYYYMM using this script

LET VPath_xx     =     num(year(today())*100+month(today())) and it works fine.

Now i would like to create another variable but subtracting 12 months from the current date.

The final result should be something like this : 201710



Could you please give me some suggestion ?

Thanks in advance for your support

have a nice day

Mauro

3 Replies
undergrinder
Specialist II
Specialist II

Hi Mauro,

Try this:

=date(addmonths(today(),-10),'YYYYMM')

G.

mauvasco62
Contributor III
Contributor III
Author

Great!

it works fine

Thank you

Mauro

agigliotti
Partner - Champion
Partner - Champion

let's try as below:

LET VVar2     =     num(year(addmonths(today(), -12))*100+month(addmonths(today(), -12)));


I hope it helps.