Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
Not applicable

if(isnull) statement

Try to use this formula but i'm getting 'Error in Expression: If takes 2-3 parameters'

Help me with this to work properly.

if(isnull([SHIP_DT]) = false and isnull([P_RETURN_DT])=false) then

(sum(([SALE_RPRICE])*([ORDER_QTY]))*(-1));

else if(isnull([SHIP_DT])=false and isnull([P_RETURN_DT])=true) then

sum(([SALE_RPRICE])*([ORDER_QTY]));

else

'0';

end if

Thank you

3 Replies
Highlighted
Honored Contributor II

Re: if(isnull) statement

Try this:

if not isnull([SHIP_DT])  and not isnull([P_RETURN_DT]) then

(sum(([SALE_RPRICE])*([ORDER_QTY]))*(-1));

else if not isnull([SHIP_DT]) and isnull([P_RETURN_DT]) then

sum(([SALE_RPRICE])*([ORDER_QTY]));

else

'0';

end if

Highlighted
Not applicable

Re: if(isnull) statement

Thanks for the reply,

but i'm getting 'Grabage after expression: 'not'

Highlighted

Re: if(isnull) statement

How about this?

If(Len(Trim([SHIP_DT])) > 0 and Len(Trim([P_RETURN_DT])) > 0, Sum(([SALE_RPRICE])*([ORDER_QTY])) * (-1),

If(Len(Trim([SHIP_DT])) > 0 and Len(Trim([P_RETURN_DT])) = 0, Sum(([SALE_RPRICE])*([ORDER_QTY])), 0))