Skip to main content
Announcements
Join us on Sept. 17 to hear how our new GenAI Assistant empowers data professionals: REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
sodavid
Contributor II
Contributor II

Group by Year

Dear Qlik Community,

I would like to group my Products by PEDYear automatically by also using another script instead of writing the actual years.

Ideally something like PEDYear >=AddYears(Today(),-8) should give me products with PEDYear = 2015.

NRfst:
Load Product,
If( PEDYear >=2015, 'SLP Group',

IF(PEDYear <= 2014 and PEDYear >=2008, '15 Years Group',

IF(PEDYear <= 2007 and PEDYear >=1998, '25 Years Group',

IF(PEDYear <= 1997 , 'Older than 25 Years'

)))) as AgeRange

Resident [Master_Data];

 

 

Thanks in advance for any response.

Labels (1)
1 Reply
vikasmahajan

Hi ,

Refer post you can create flags for respective years & make use of flags in set analysis:

https://community.qlik.com/t5/Member-Articles/As-of-Table-with-YTD-MTD-QTD-amp-Calculation-of-Rollin...

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.