5 Replies Latest reply: Jul 19, 2016 4:55 AM by June Kim

# way to work this formula on Qlik Sense

Try to use this formula below, but Qlik Sense doesn't allow me to do so..

Can someone edit this to work on the Qlik S please?

Thank you

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

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

elseif (isnull([SHIP_DT])=False and isnull([P_RETURN_DT])=True) then

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

else

0

END

• ###### Re: way to work this formula on Qlik Sense

Perhaps like this: sum({<SHIP_DT={'*'}>}SALE_RPRICE*ORDER_QTY) * If(IsNull(P_RETURN_DT),1,-1)

If P_RETURN_DT is a date field, i.e. a number too, then you could try

sum({<SHIP_DT={'*'}>}SALE_RPRICE*ORDER_QTY) * -Alt(P_RETURN_D/P_RETURN_D,-1)

• ###### Re: way to work this formula on Qlik Sense

Thank you so much

It works!

• ###### Re: way to work this formula on Qlik Sense

Can you explain that function?

• ###### Re: way to work this formula on Qlik Sense

Which one?

• ###### Re: way to work this formula on Qlik Sense

Can you fix these two formulas?

1 -

IF [P_RETURN_DT]=[date] and ISNULL([P_RETURN_DT])=FALSE then

[ORDER_QTY]*[SALE_RPRICE]*-1

ELSE

0

END

2 -

IF [SHIP_DT]=[date] and ISNULL([SHIP_DT])=FALSE then

[ORDER_QTY]*[SALE_RPRICE]

ELSE

0

END