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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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
MVP
MVP

let's try as below:

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


I hope it helps.

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it