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: 
LucaB-1991
Contributor
Contributor

Retrieve “Year” field value from a list of “YearMonth” values

Hi everyone,

I need some help!

In qlik senso how can I extract years’values from a multiple selected YearMonth values?

For example:

If the user selects 201701, 201801,201901 from YearMonth filter box, in set analysis I want this behaviour : Year = {2017, 2018, 2019}.

Is there a way to achive this ?

1 Solution

Accepted Solutions
tresesco
MVP
MVP

You can use a variable or the expression directly in set analysis.

 = '{' & Concat(Distinct Left(YearMonth,4), ',' ) & '}'                           

 

 

View solution in original post

3 Replies
DavidM
Partner - Creator II
Partner - Creator II

If YearMonth is $date type field you can do it with function Year(). Or you can use just left:

Year = {"=Left( [Year] ,4)"}

tresesco
MVP
MVP

You can use a variable or the expression directly in set analysis.

 = '{' & Concat(Distinct Left(YearMonth,4), ',' ) & '}'                           

 

 

LucaB-1991
Contributor
Contributor
Author

Thank you very much.
It works!