Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
IF(ISNULL(TYPE)=0,'NOT_LEGAL',ELSE,'LEAGL')AS CATEGERY
I have written above code in my script. But It is not working. Can some correct it for me please.
My requirement is if TYPE is null then the category should be 'NOT LEGAL' else 'LEGAL'
Try:
if(isNull(TYPE), 'NOT LEGAL', 'LEGAL') as CATEGORY
IsNull will return 0 (representing false) is the TYPE field contains a non-null value. The Qlikview if statement syntax doesn't use the 'else' keyword - comma characters are used to separate the if/then/else parts of the statement.
Hope this helps!
Try:
if(isNull(TYPE), 'NOT LEGAL', 'LEGAL') as CATEGORY
IsNull will return 0 (representing false) is the TYPE field contains a non-null value. The Qlikview if statement syntax doesn't use the 'else' keyword - comma characters are used to separate the if/then/else parts of the statement.
Hope this helps!
Hi,
It should be like this:
IF(ISNULL(TYPE), 'NOT LEGAL', 'LEGAL') AS CATEGORY
Thanks for your reply and the explanation
Hi What if i need multiple conditions like these?
This is my expression =IF(ISNULL(INVENTORY_STATUS=1), '', 'UNRESTRICTED') its working how can i add other expected result
Inventory Status | Expected Result |
1 | UNRESTRICTED |
6EXP | BLOCKED |
6DMG | BLOCKED |
6QRN | QUARANTINE |
@Eduard23 as below
If(INVENTORY_STATUS=1,'UNRESTRICTED',
If(INVENTORY_STATUS='6EXP','BLOCKED',
If(INVENTORY_STATUS='6DMG','BLOCKED',
If(INVENTORY_STATUS='6QRN','QUARANTINE',Null()))))
i try this one it is working but then one from BrunPierre is also working, thanks
IF(INVENTORY_STATUS=1, 'UNRESTRICTED',IF(INVENTORY_STATUS='6DMG', 'BLOCKED',IF(INVENTORY_STATUS='6EXP', 'BLOCKED',IF(INVENTORY_STATUS='6QRN', 'QURANTINE', ''))))