Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Trying to use this statement in my load script. I would like to calculate value in script using two different prices * qty, rather doing calculation in chart object. I keep getting invalid expression errors.
duty code
Orig_Sales_Price
Req_qty
Local_Sales_prices
are all fields
if (DUTY_CODE = 'M', sum((ORIG_SALES_PRICE) * (REQ_QTY)), sum((LOCAL_SALES_PRICE) * (REQ_QTY))) as BKLGVALUE
Please advise if this possible. The syntax works in fine in chart object, but performance is affected.
Hi,
When you use SUM in your load script you have to add a GROUP BY clause as well. I suppose this it what you are looking for:
if (DUTY_CODE = 'M', ORIG_SALES_PRICE * REQ_QTY, LOCAL_SALES_PRICE * REQ_QTY) as BKLGVALUE
This way you will have price*qty per row. Now you can SUM(BKLGVALUE) in your chart.
Regards
Hi,
When you use SUM in your load script you have to add a GROUP BY clause as well. I suppose this it what you are looking for:
if (DUTY_CODE = 'M', ORIG_SALES_PRICE * REQ_QTY, LOCAL_SALES_PRICE * REQ_QTY) as BKLGVALUE
This way you will have price*qty per row. Now you can SUM(BKLGVALUE) in your chart.
Regards
I'm loading my application from a qvd file? Group by works with QVD?
Hi,
Yes, GROUP BY works with QVD, but you don't need it. You can simply use what I have given you above. Maybe I didn't communicate properly. GROUP BY was just some background information.
Thanks wernbrenk....I really appreciate your assistance.