Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I need to use a multiple if statement, but I can't seem to get it to work.
I have a column of data that has either a '2', a '6', a '41' or is empty. If i enter the following in a calculated dimension, in a straight table, I get all the 2's and everything else says 'None'.
IF(Lock_Category <> '2', 'None', Lock_Category)
So how can I amend this to say, if the Lock Category is not equal to 2,6 or 41, to show 'None' , but still show the 2's, 6's and 41's.
Thanks.
check out the MATCH function.
match( M, 'Jan','Feb','Mar')
returns 2 if M = Feb
returns 0 if M = Apr or jan
Andrew,
please provide sample data we can play with.
Thank you!
Rainer
IF ( Match(Lock_Category ,2,6,41) = 0, 'None',Lock_Category ) as Lock_Category
That didn't work, but this nearly does:
IF(MATCH(Lock_Category,2,6,41)=0, Lock_Category, 'None')
When used as a calculated dimension it places all the 2's and 6's correctly, and empties as 'None', but is also placing a 'None' in the 41's?
try
IF(MATCH(Lock_Category,2,6,41, '2', '6', '41')=0, 'None',Lock_Category)
Original suggestion worked for me on test script
Might be worth trying to either remove the blank before the closing bracket like ",41)" or to enclose the digits with apostrophs.
Peter
Whichever way I do it, it seems to assume that '41' is 'None', and if I put it in the script, it also makes the 41's 'None', but also leaves all the empty cells empty.
Think you must be missing something very basic.... it happens with all of us...
Post some sample data in an app and I'll have a look
sometimes the computer says 'No'
Hi!
You may be missing comparing Num(Field) with 2,6,41 and all possible values you want to match. You may use as well a mapping load in the load statement. Anyway, bear in mind that QlikView doesn't have "data types". If you want to compare your date field with some dates, you better use date(field) vs. date(value) to ensure matching success...