Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
neerajthakur
Creator III
Creator III

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 

Thanks & Regards,
Please Accepts as Solution if it solves your query.
1 Solution

Accepted Solutions
MarcoWedel

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

 

View solution in original post

2 Replies
Or
MVP
MVP

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

 

MarcoWedel

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