Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Save $300 - Register for QlikWorld (formerly Qonnections) by January 31st: Learn More
TomBond77
New Contributor III

Multiple IF conditions on one field

Hi experts

I need to fill a new field "compliant". Only one field "Field A" should be in the condition.

(If([Field A] = '0', '0') OR IF([Field A] = '3', '3') OR If([Field A] = '4', '4') OR If([Field A] = '5', '5')) as [Compliant],

Unfortunately the result in the app shows "-1" , and not the required value in the conditions.

Can you plesae support and help?

Many thanks

Tom

1 Solution

Accepted Solutions
Partner
Partner

Re: Multiple IF conditions on one field

By the looks of it you don't need to use multiple if's.

 

Try this:

/*If Field A is 0,3,4 or 5 then use the value of Field A */
If( match([Field A], '0', '3','4','5'), [Field A]) as [Compliant],

 

Plees ekskuse my Swenglish and or Norweglish spelling misstakes

View solution in original post

2 Replies
Partner
Partner

Re: Multiple IF conditions on one field

By the looks of it you don't need to use multiple if's.

 

Try this:

/*If Field A is 0,3,4 or 5 then use the value of Field A */
If( match([Field A], '0', '3','4','5'), [Field A]) as [Compliant],

 

Plees ekskuse my Swenglish and or Norweglish spelling misstakes

View solution in original post

Partner
Partner

Re: Multiple IF conditions on one field

If you do need to use multiple if statements then try this:

 

IF([Field A]= '0', '0',
    IF([Field A]= '3', '3',
        IF([Field A]= '4', '4',
             IF([Field A]= '5', '5', Null() )))) as [Compliant]

Plees ekskuse my Swenglish and or Norweglish spelling misstakes