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: 
Black_Hole
Creator II
Creator II

Time function in a script

Hello all,

I put in my script the following expression

SET vPeriod= Year(Today())&Month(Today());

I am expecting to have the result : 202004

Please could you help me to confirm if this expression gives the result above or not.

 

Many thanks in advance for your help.

Have a nice day  !

Labels (2)
2 Solutions

Accepted Solutions
Frank_Hartmann
Master II
Master II

Year(Today())&num(Month(Today()),'00')

View solution in original post

tresB
Champion III
Champion III

Change your SET to LET, and then try like:

LET vPeriod= Year(Today())*100 + Month(Today());

 

Or like string operation shown above by Frank

View solution in original post

3 Replies
Frank_Hartmann
Master II
Master II

Year(Today())&num(Month(Today()),'00')

tresB
Champion III
Champion III

Change your SET to LET, and then try like:

LET vPeriod= Year(Today())*100 + Month(Today());

 

Or like string operation shown above by Frank

Black_Hole
Creator II
Creator II
Author

Hello @Frank_Hartmann , @tresB ,

The expression works without any issue.

Thank you for your quick and effective solution. 👍