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

inlist in if then else

Hi Friends,

I have posted a query which was half answered about the date ranges, and since that was not possible with Set Analysis I have made the following query which works fine.

if(

(($(vSysDate)>= $(vDropDeadMonth))

AND ($(vSysDate)<= $(vDropDeadDate))

AND (Status=('Pre Approved')

OR Status=('Approved'))

AND (Outcome=('Funded')

OR Outcome=('Funded')

OR Outcome=('Funded')

OR Outcome=('Funded')

OR Outcome=('Funded'))

)

OR

(($(vSysDate)>= $(vDropDeadLastWk))

AND ($(vSysDate)<= $(vDropDeadDate))

AND (Status=('Pre Approved')

OR Status=('Approved'))

AND (Outcome=('Funded')

OR Outcome=('Funded')

OR Outcome=('Funded')

OR Outcome=('Funded')

OR Outcome=('Funded'))

)

,'Yes','No'

)

As you can see for both the Status and Outcome , if we have something like InList it would be great , please suggets.

Ex:Status InList('Approved','Pre Approved')

2 Replies
petter
Partner - Champion III
Partner - Champion III

You can use Match do check against a list of text strings:

Match( Status , 'Approved' , 'Pre Approved' , ..... ) > 0

Actually just

Match( Status , 'Approved' , 'Pre Approved' , ..... )


Will leave you with the right test since you get a positive number if there is a match and 0 if not. Any non zero return will be interpreted as true and zero will be false.

Not applicable
Author

Thanks Petter, it was helpful

if(

(($(vSysDate)>= $(vDropDeadMonth))

AND ($(vSysDate)<= $(vDropDeadDate))

AND Match( Status , 'Approved' , 'Pre Approved')

AND (Outcome=('Funded')

OR Outcome=('Phased Funded')

OR Outcome=('Conditionally Funded')

OR Outcome=('Partially Funded'))

)

OR

(($(vSysDate)>= $(vDropDeadLastWk))

AND ($(vSysDate)<= $(vDropDeadDate))

AND Match( Status , 'Approved' , 'Pre Approved')

AND Match( Outcome , 'Funded' , 'Phased Funded','Conditionally Funded','Partially Funded')

)

,'Yes','No'

)