Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi there,
Completely novice to Qlikview so apologies for a simple question....
I was originally using:
sum({<RetailYear = {'2013'}>}Quantity)*TradePrice
Which I then worked out will multiply the sum of the trade price by the sum of the quantity for the retail year 2013 which is not correct.
So I need to add 'only' into the formula so that it multiplies the trade price only, not the sum of the trade price. I've tried the below as it seems to make the most logical sense but it doesn't work (has an 'error in expression'). Where should the 'only' be?
sum({<RetailYear = {'2013'}>}Quantity)*only(TradePrice)
TIA
Sarah
Try this
sum({<RetailYear = {'2013'}>} Quantity * TradePrice)
Only returns a single value if the selected field has a single value otherwise it returns null.
Alternatively you can in the script do
Quantity * TradePrice as [# Amount]
Then in the document
sum({<RetailYear = {'2013'}>} [# Amount])
Better you do this calculation in script only.
or use max/min instead of only in expression if you are having single tradeprice of every item in price master..
Hi,
You Can create value like,
As per Michael Answer,
Let vAmt = Num(Quantity * TradePrice,'<Format >');
Then,
Sum ({RetailYear = { '2013'}>} $(vAmt)}
Regards,
Raja.