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

Announcements
Talend Cloud AWS EU Scheduled Outage: Starting Tues 26 May 21:00 CEST with expected completion Wed 27 May 01:00 CEST
cancel
Showing results for 
Search instead for 
Did you mean: 
zwyne
Creator
Creator

If then condition

Hello everyone,

How can I write the statement below to produce one Flag instead of two like I did?

if(Match([Issue Priority],'Major')and Match([Issue Status],'On Track'),'MajFlagTrc' ,
        if(Match([Issue Priority],'Major')and Match([Issue Status],'Pipeline') and DaysFlag='30 Days','MajFlagPipe'

I am talking about the 'MajFlagTrc'  and 'MajFlagPipe'

 

Thanks

1 Solution

Accepted Solutions
zwyne
Creator
Creator
Author

Something like this

if(Match([Issue Priority],'Major'),
      if(Match([Issue Status],'On Track') or (Match([Issue Status],'Pipeline') and DaysFlag='30 Days'),'MajFlag',

I have tried it but it's not working as expected.

 

View solution in original post

6 Replies
sunny_talwar

One flag? Which one of the two you want to produce?
zwyne
Creator
Creator
Author

Something like this

if(Match([Issue Priority],'Major'),
      if(Match([Issue Status],'On Track') or (Match([Issue Status],'Pipeline') and DaysFlag='30 Days'),'MajFlag',

I have tried it but it's not working as expected.

 

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

if(Match([Issue Priority],'Major')and Match([Issue Status],'On Track'),'MajFlagTrc' ,
        if(Match([Issue Priority],'Major')and Match([Issue Status],'Pipeline') and DaysFlag='30 Days','MajFlagPipe'

)) as Flag

 

You just need to close out the if() statements and add an "as" to assign to  a field.

zwyne
Creator
Creator
Author

It turned out this expression is correct

if(Match([Issue Priority],'Major'),
      if(Match([Issue Status],'On Track') or (Match([Issue Status],'Pipeline') and DaysFlag='30 Days'),'MajFlag'

sunny_talwar

Even without the ending parenthesis as suggested by @rwunderlich
zwyne
Creator
Creator
Author

Actually my statement is incorrect, I am talking about  this one

if(Match([Issue Priority],'Major'),
       if(Match([Issue Status],'On Track') or (Match([Issue Status],'Pipeline') and DaysFlag='30 Days'),'MajorFlag'

The problem is   the or operator.