Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor

Facing issue while creating if condition in script

Hi Friends,

      I have few columns like status, Id, detailed_description, Comments. Based on this columns i need to define new column like NULL,  ID was submitted with error, not repeated, Duplicate ID, Working as expected , Option not to fix, Rejected and Invalid_Rejected(8 values). while i am creating the condition i am not getting expected output.I am getting missing value in new column. I am giving condition below. Can any one please help me on this.

Points:

1)if status is rejected and comments is blank or Detailed_Description is blank then Null
2)if status is rejected and comments and detailed_description has some keyword we need to search with those keywords and create a values as ID was submitted with error, not repeated, Duplicate ID, Working as expected and Option not to fix.
3)if not find any keyword from above condition then we need to define another condition by using detailed_description is rejected or comments is rejected then rejected else invalid_rejected

Based on above points i have written the condition:

if(status='Rejected',
if(wildmatch(Detailed_Description,'*Id was submitted with error*','*Invalid*'),
if(wildmatch(comments,'*Id was submitted with error*','*Invalid*'),'ID was submitted with error'),
if(wildmatch(Detailed_Description,'*Cannot be created*','*Cannot Repeated*'),
if(wildmatch(comments,'*Cannot be created*','*Cannot Repeated*'),'Not repeated'),
if(wildmatch(Detailed_Description,'*Same*','*Similar*'),
if(wildmatch(comments,'*Same*','*Similar*'),'Duplicate ID'),
if(wildmatch(Detailed_Description,'*Working as expected*','*working as story*'),
if(wildmatch(comments,'*Working as expected*','*working as story*'),'Working as expected'),
if(wildmatch(Detailed_Description,'*Work around*','*accept*'),
if(wildmatch(comments,'*Work around*','*accept*'),'Option not to fix')
))))),
if(status='Rejected',
if(not(wildmatch(Detailed_Description,'*Id was submitted with error*','*Invalid*')) or
not(comments,'*Id was submitted with error*','*Invalid*')),
if(not(wildmatch(Detailed_Description,'*Cannot be created*','*Cannot Repeated*')) or
not(comments,'*Cannot be created*','*Cannot Repeated*')),
if(not(wildmatch(Detailed_Description,'*Same*','*Similar*')) or
not(wildmatch(comments,'*Same*','*Similar*')),
if(not(wildmatch(Detailed_Description,'*Working as expected*','*working as story*')) or
not(wildmatch(comments,'*Working as expected*','*working as story*')),
if(not(wildmatch(Detailed_Description,'*Work around*','*accept*')) or
not(wildmatch(comments,'*Work around*','*accept*')),
if(wildmatch(comments,'*Rejected*','*Re jct*') or wildmatch(Detailed_Description,'*Rejected*','*Re jct*'),'Rejected', 'Invalid_Rejected'
)))))
))) as Reason

Can any one help me on this above condition.Thanks in Advance

1 Reply
Digital Support
Digital Support

I believe you are going to need to attach a sample app on this one in order to get further help, if you can do that, I suspect someone may be able to reply and help you out at that point.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.