Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am trying to
Iam trying to create an simple IF Condition with Sum. But iam getting invalid expression error while loading the script
Load,
AccountID,
SAAP,
IF([currency] = 'EUR',Sum([Transaction amount]),Sum([Transaction amount]) *Rates) as [Final Amount]
From .......qvd(qvd);
Group by
AccountID,
SAAP;
For debugging I changed as below and it works.. looks like the second sum statement it is not accepting..
IF([currency] = 'EUR',Sum([Transaction amount]),'1') as [Final Amount].
Thanks to suggest
You need an aggregation on Rates since you are using Group by. try * sum(Rates) or * avg(Rates) or Sum([Transaction amount] * Rates)