New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Talk to Experts Tuesday, January 26th at 10AM EST: Qlik Sense. REGISTER NOW
cancel
Showing results for
Did you mean:
Creator

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

Labels (1)
• Multiple IF conditions on one field

1 Solution

Accepted Solutions
Partner

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
2 Replies
Partner

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
Partner

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
Tags