Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
danielnevitt
Creator
Creator

Expression help

Hi,

I have an expression that I wish to calculate on a field.

If TRADE_TYPE = Basis Swap then multiply PAYMENT_QTY*(PRICE1-PRICE2)

If TRADE_TYPE = Swap then multiply PAYMENT_QTY*PRICE1

I have created the following expressions for the above, however I am unsure how to express them as a multiple IF statement:

Sum({<TRADE_TYPE={'Basis Swap'}>}PRICE1-PRICE2)*PAYMENT_QTY

Sum({<TRADE_TYPE={'Swap'}>}PRICE1*PAYMENT_QTY

Any help would be much appreciated.

Thanks,

Daniel

10 Replies
danielnevitt
Creator
Creator
Author

Hi Dathu.qv,

I have another quick question with regards to the above expression.  How do I add where CO_CD is not equal to ICEClearingGS, ImarexClearing and STShippingTranPteLtd?

I thought I needed to add the following, but it doesn't work:

SUM( IF(TRADE_TYPE='Swap' AND COST_REVENUE_IND='Cost (Payable)' AND CO_CD={'*'}-{'ICEClearingGS','ImarexClearingGS','STShippingTranPteLtd'} , PAYMENT_QTY*(-PRICE1) , IF(TRADE_TYPE='Swap' AND COST_REVENUE_IND='Revenue (Receivable)' ,PAYMENT_QTY*PRICE2 ,0 ) ))

Thanks for your help,

Regards,

Daniel