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: 
Not applicable

IF statement with more than one condition (Script)

What is going wrong in the following script?

Only when Spend_time is according to the conditions A = NO, B = hour and C=Prestatie I want de value of Spend_time to be saved als Spend_Hours, else, return value zero.

  IF (A ='NO',
      
IF (B ='hour', IF(C ='Prestatie', Spend_time,
       0),0),0)     
AS Spend_hours,

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

If I understood you correctly:

If(A = 'No' And B = 'hour' And C = 'Prestatie', Spend_time, 0) As Spend_hours,

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

3 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

If I understood you correctly:

If(A = 'No' And B = 'hour' And C = 'Prestatie', Spend_time, 0) As Spend_hours,

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Hi,

Try to put all the conditions together as If( A='NO' and B='hour' and C='Prestatie', Spend_Time, 0) as Spend_Hours.


Not applicable
Author

Hi,

try

if((A ='NO') AND (B ='hour') AND (C ='Prestatie'), Spend_time,'0') as Spend_hours