Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
LucaB-1991
New 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 ?

Labels (2)
1 Solution

Accepted Solutions
MVP
MVP

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

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

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

 

 

View solution in original post

3 Replies
Partner
Partner

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

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

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

MVP
MVP

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

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

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

 

 

View solution in original post

LucaB-1991
New Contributor

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

Thank you very much.
It works!