Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
data_RN
Creator
Creator

If statement with Not Equal to

Hello All, 

I am trying to work through a detailed requirement based on various criteria, but I cannot figure out how to include the "not equal" factor into the formula.

Does anyone know how to resolve this?

Thanks in advance!

What I am trying:

if(NPV<0, fAbs(NPV)
,if(NPV = 0 AND [Stage] = 'New' ,0
,if(NPV = 0 AND [Stage] <> 'Archived' AND Sum([Spend)])<>0,((Sum[Spend])*2))

,NPV)

)))

Spend NPV Stage Expected RESULT
10 0 Alpha 20
0 0 New 0
5 -2 Alpha 2
3 1 New 1
-5 3 New 3
7 3 Archived 3
Labels (3)
1 Solution

Accepted Solutions
BrunPierre
Partner - Master
Partner - Master

Hello! It should work except for some misplaced parentheses. Also, you have uncheck the "Suppress Zero Values" or "include zero values" checkbox.

If(NPV < 0, fAbs(NPV),
If(NPV = 0 AND [Stage] = 'New', 0,
If(NPV = 0 AND [Stage] <> 'Archived' AND Sum([Spend]) <> 0, Sum([Spend]) * 2, NPV )))

View solution in original post

2 Replies
BrunPierre
Partner - Master
Partner - Master

Hello! It should work except for some misplaced parentheses. Also, you have uncheck the "Suppress Zero Values" or "include zero values" checkbox.

If(NPV < 0, fAbs(NPV),
If(NPV = 0 AND [Stage] = 'New', 0,
If(NPV = 0 AND [Stage] <> 'Archived' AND Sum([Spend]) <> 0, Sum([Spend]) * 2, NPV )))

data_RN
Creator
Creator
Author

Great...This is it! thanks @BrunPierre !