8 Replies Latest reply: Jul 21, 2016 6:36 AM by Digvijay Singh

# Way to fix expressions

Can someone fix these formulas in order to work on Qlik Sense?

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

3 - If I'd like to add those two expressions, should I do like this?

-  [1]+[2]

Thank you.

• ###### Re: Way to fix expressions

if(((isNull(Date)=-1 or len(trim(Date))=0) and

isnull(Date1)=-1),(Qty*SalesPrice)*-1,0)

• ###### Re: Way to fix expressions

Not workding

• ###### Re: Way to fix expressions

if((len(trim([P_RETURN_DT])>0 and [P_RETURN_DT]=[date]),[ORDER_QTY]*[SALE_RPRICE],

if((len(trim([SHIP_DT])>0 and [SHIP_DT]=[date]),-1*[ORDER_QTY]*[SALE_RPRICE],0))

• ###### Re: Way to fix expressions

Thanks for the reply, but not working

• ###### Re: Way to fix expressions

Try this, ensure dates are not in text format.

-Alt(if([P_RETURN_DT]=[date],[ORDER_QTY]*[SALE_RPRICE]*-1),0)

-Alt(if([SHIP_DT]=[date],[ORDER_QTY]*[SALE_RPRICE]),0)

• ###### Re: Way to fix expressions

How should I add those two?

• ###### Re: Way to fix expressions

You can give labels to them and can use label name as Exp1,Exp2 etc and then use third expression as Exp1 + Exp2