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

using 2 Match functions in if statement

‌hi,

I have a field (CreateDate) in format DD/MM/YYYY

a variable (vHolidayList) which contains the value ('02/05/2016','24/04/2016','28/04/2016','26/12/2016','27/12/2016'..... )

I am using match function in If condition as shown below

if(match(CreateDate, $(vHolidayList)) and match(CreateDate+1, $(vHolidayList)) > 0, 'True condition', 'NA') as column

I am getting NA everytime but if I remove the 2nd match in the above if statement then I am getting the true condition. Can you please suggest how to use 2 match in the if statement ? I want to check if the createdate is the same to the holidaydate where holidaydate if is consecutive (e.g. 26/12 and 27/12) then another set of calculations are done in my true condition.

Can you please let me know the way forward?

Regards,

Romila

1 Solution

Accepted Solutions
maxgro
MVP
MVP

try adding a date

Date(CreateDate+1)

View solution in original post

5 Replies
sunny_talwar

May be try this"

if(match(CreateDate, $(vHolidayList)) and match(Date(CreateDate+1, 'DD/MM/YYYY'), $(vHolidayList)), 'True condition', 'NA') as column

UPDATE: Removed the > 0 condition after the second match function

maxgro
MVP
MVP

try adding a date

Date(CreateDate+1)

robhagat
Contributor III
Contributor III
Author

Thanks, it worked

robhagat
Contributor III
Contributor III
Author

Thank you so much. It worked but now I am facing another issue.

I am getting the following error every time. Does this mean it is performance issue?

sunny_talwar

This seems to be from a totally unrelated issue.... Not sure what might be causing this