Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
AC
Contributor II
Contributor II

Issue with if Match function in Straight Table Dimension

Hello,

        I have an Issue with the If Match function, I have a field called Last_Ping_Status and  the values are 1 DAY, 2 DAYS, 3 DAYS.....60 DAYS, OVER 60 DAYS and UNKNOWN from this I was trying to display first 7 DAYS (1 DAY, 2 DAYS...7 DAYS) and for that I am using below expression in my Straight Table dimension. 


=if(match(Last_Ping_Status,'1 DAY','2 DAYS','3 DAYS','4 DAYS','5 DAYS','6 DAYS','7 DAYS'),Last_Ping_Status)

The above expression is not giving any error but I am not getting anything in the table see below.

I have tried with some sample data in another test qvw but the same if match condition is working there not sure why it is not working in my actual qvw and i have tried with wildmatch as well.

Capture3.PNG

1 Solution

Accepted Solutions
wdchristensen
Specialist
Specialist

Perhaps the values of "Last_Ping_Status" are not exactly the same as your match condition. The case could be off or leading or trailing spaces. Might try:

if(match(TRIM(UPPER(Last_Ping_Status)),'1 DAY','2 DAYS','3 DAYS','4 DAYS','5 DAYS','6 DAYS','7 DAYS'),Last_Ping_Status)


If the above upper and trim didn't fix the issue, might try the below and examine the output.


if(match(TRIM(UPPER(Last_Ping_Status)),'1 DAY','2 DAYS','3 DAYS','4 DAYS','5 DAYS','6 DAYS','7 DAYS'),Last_Ping_Status, '-' & Last_Ping_Status '-' & ' This should not include values between 1 and 7 days.')


Can you please post your load script? I have the free version of QlikView and can't open the QVF since I am not the creator.

View solution in original post

3 Replies
wdchristensen
Specialist
Specialist

Perhaps the values of "Last_Ping_Status" are not exactly the same as your match condition. The case could be off or leading or trailing spaces. Might try:

if(match(TRIM(UPPER(Last_Ping_Status)),'1 DAY','2 DAYS','3 DAYS','4 DAYS','5 DAYS','6 DAYS','7 DAYS'),Last_Ping_Status)


If the above upper and trim didn't fix the issue, might try the below and examine the output.


if(match(TRIM(UPPER(Last_Ping_Status)),'1 DAY','2 DAYS','3 DAYS','4 DAYS','5 DAYS','6 DAYS','7 DAYS'),Last_Ping_Status, '-' & Last_Ping_Status '-' & ' This should not include values between 1 and 7 days.')


Can you please post your load script? I have the free version of QlikView and can't open the QVF since I am not the creator.

AC
Contributor II
Contributor II
Author

Thank you William, this is working perfectly but why the same working in my sample file with simple if match, in the sample file also i have different values

wdchristensen
Specialist
Specialist

Glad you got it working!