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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sum If in Expressions

Hello, I'm a newbie to Qlikview and I want to do something that should be so so simple but I just can't figure it out!

I've set up some manual expressions for the currency exchange rate (vEUR, vSGD and vUSD) In these fields you have the excahnge rate from GBP.

All I then want to do is calculate if the Share Class is EUR multiple the figure by vEUR. If it's USD multiply it by vUSD.

This should be so so simple but it's just not.

In excel or SSRS I would just do something like:

iif([Share Class] like 'USD' TradeValue * vUSD, iif([Share Class] like 'EUR', Trade Value * vEUR, Trade Value))

But I just can not work out how I can do this.

Please can someone help me!!

Thanks,

Phil

2 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try:

sum([Trade Value] * if([Share Class] = 'USD', vUSD, if(Share Class] = 'EUR ', vEUR, 1)))


talk is cheap, supply exceeds demand
Not applicable
Author

Yeah I can see how that would work, but what would the actual code be for that in the expression field? Would it need a sum? Would it need all {} 's and $'s?? I’m a newbie to Qlikview so apologies for my poor knowledge.... have to start somewhere though!

Thanks,

Phil