Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

If Else Condition

In the below table, I have to check for each GrpID, if there is D between 2010 and 2015. If there is a D then print the corresponding ID if not then print the ID for 2015.

YearGrp IDIDCode
2009807268061234BB
2010807268061235BB
2011807268061236D
2012807268061237BB
2013807268061238BB
2014807268061239BB
2015807268061240BB
2009807268131241BB
2010807268131242B
2011807268131243B
2012807268131244B
2013807268131245BB
2014807268131246B
2015807268131247BB

  

Grp IDID
807268061236
807268131247

How do I do that? TIA.

1 Solution

Accepted Solutions
sunny_talwar

May be this:

=Alt(Only({<Year = {2010, 2011, 2012, 2013, 2014, 2015}, Code = {'D'}>}ID), Only({<Year = {2015}>}ID))


Capture.PNG

View solution in original post

2 Replies
sunny_talwar

May be this:

=Alt(Only({<Year = {2010, 2011, 2012, 2013, 2014, 2015}, Code = {'D'}>}ID), Only({<Year = {2015}>}ID))


Capture.PNG

MarcoWedel

Hi,

depending on your requirements (2015 = Max(Year)?) another solution might be:

QlikCommunity_Thread_219680_Pic1.JPG

hope this helps

regards

Marco