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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Thomas94
Contributor II
Contributor II

Season year code?

Hi everyone,

 

I'm trying to combine the last 2 numbers from the year with the first character of the season.

For example: W19, S19

 

I'm usising following code:

='W'&max(right(num( Year(AddMonths(Today(),-1)) ),2))

This works, but when I create a variable of it, the result is "-".  Very strange because it's the same code as the expression.

My variable Seizoenscode :

='W'&max(right(num( Year(AddMonths(Today(),-1)) ),2))

The set analyses I want to use the variable: 

Seizoenscode={$(=$(vSeizoencodeCY))}

Anyone who knows how I can fix this?

thanks in advance

1 Solution

Accepted Solutions
vijetas42
Specialist
Specialist

try to add variable as 'W'&max(right(num( Year(AddMonths(Today(),-1)) ),2)) without '=' sign and then you can use as $(variable)

View solution in original post

2 Replies
vijetas42
Specialist
Specialist

try to add variable as 'W'&max(right(num( Year(AddMonths(Today(),-1)) ),2)) without '=' sign and then you can use as $(variable)
Thomas94
Contributor II
Contributor II
Author

It worked! Thank you for your help