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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
raadwiptec
Creator II
Creator II

If and Sum

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

 

Labels (1)
1 Reply
stevejoyce
Specialist II
Specialist II

You need an aggregation on Rates since you are using Group by.  try * sum(Rates) or * avg(Rates) or Sum([Transaction amount] * Rates)