Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys,
i am having trouble to create this Tableau expression in Qlik
IF SUM([Field1])=0 OR SUM([Field2])=0 THEN SUM([Adjustment Quantity])/1 ELSE SUM([Field1])/SUM([Field2]) END
In that case, you'll need to work around the lack of AND/OR by nesting if() statements, or combine the conditions, e.g.
If(Sum(Field1)*Sum(Field2) <> 0,Something, SomethingElse)
might achieve the same purpose as checking each field for zero individually.
Seems like a straightforward If() statement? See: https://help.qlik.com/en-US/qlikview/May2021/Subsystems/Client/Content/QV_QlikView/Scripting/Conditi...
IF(SUM([Field1])=0 OR SUM([Field2])=0 ,SUM([Adjustment Quantity]) ,SUM([Field1])/SUM([Field2]))
yeah, but i have issue with combining that with OR and AND statements
Generally, if(Condition1 OR Condition2,When_True,When_False) is the syntax. This should work in both the Load Script Editor and in Qlik formulas (but not the Data Manager, for reasons known only to the fine folks at Qlik)
Ohh Thank you a lot !
I was trying to do this in Data Manager, so this pretty much explains the problem
In that case, you'll need to work around the lack of AND/OR by nesting if() statements, or combine the conditions, e.g.
If(Sum(Field1)*Sum(Field2) <> 0,Something, SomethingElse)
might achieve the same purpose as checking each field for zero individually.