- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How can I write this in QlikView
(CASE WHEN AO.Status = 'ACCEPT' THEN 'ACCEPTED' WHEN AO.Status = 'REJECT' THEN 'REJECTED' WHEN AO.Status = 'RESUBMIT' THEN 'FOR CLARIFICATION' WHEN AO.STATUS='AMENDED' THEN 'CLARIFIED' WHEN AO.STATUS='Not In Scope' THEN 'NOT IN SCOPE ITEM' ELSE 'WAITING FOR SCRUTINY' END) 'SCRUTINY_STATUS',
I have tried the following:
if(Status='ACCEPT','ACCEPTED',
if(Status='REJECT','REJECTED',
if(Status='AMENDED','CLARIFIED',
if(Status='Not In Scope','NOT IN SCOPE ITEM',
if(Status='RESUBMIT','FOR CLARIFICATION'))))) AS SCRUTINY_STATUS, ELSE 'WAITING FOR SCRUTINY',
How can I write this I am not getting desired results it is showing Null
Please Accepts as Solution if it solves your query.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
maybe like this:
Pick(WildMatch(AO.Status,
'ACCEPT', 'REJECT' , 'RESUBMIT' , 'AMENDED' , 'Not In Scope' , '*'),
'ACCEPTED' , 'REJECTED' , ' FOR CLARIFICATION' , 'CLARIFIED' , 'NOT IN SCOPE ITEM' , 'WAITING FOR SCRUTINY'
) as SCRUTINY_STATUS
hope this helps
Marco
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
if(Status='ACCEPT','ACCEPTED',
if(Status='REJECT','REJECTED',
if(Status='AMENDED','CLARIFIED',
if(Status='Not In Scope','NOT IN SCOPE ITEM',
if(Status='RESUBMIT','FOR CLARIFICATION','WAITING FOR SCRUTINY'))))) AS SCRUTINY_STATUS
Qlik should have told you that your code is invalid, you can't put an ELSE after the 'as' (it doesn't work in SQL either)...
You could also use Pick/Match if you want to avoid the nested if() statements. See e.g. https://community.qlik.com/t5/QlikView-App-Dev/Pick-and-Match-example/td-p/1156383
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
maybe like this:
Pick(WildMatch(AO.Status,
'ACCEPT', 'REJECT' , 'RESUBMIT' , 'AMENDED' , 'Not In Scope' , '*'),
'ACCEPTED' , 'REJECTED' , ' FOR CLARIFICATION' , 'CLARIFIED' , 'NOT IN SCOPE ITEM' , 'WAITING FOR SCRUTINY'
) as SCRUTINY_STATUS
hope this helps
Marco