Conditional expressions?
Posted on August 3, 2010 at 4:46am
Hello every one. I'm new to iReport. I am trying to generate a report that has this structure :
The fields retreived from database :
and basicaly, I am asked to sum the values within a criteria, Currency. I have USD, and EUR as currencies, and the AMOUNT is in one of the two currencies I mentioned.
I created 2 variables in my Report called : USD_TOTAL and EUR_TOTAL, but I don't know how can I write an expression for those varaibles tocalculate the 2 sums. Can you please help me?
It's really urgent.
thx in advance
Joined: Jul 19 2010 - 11:30pm
Last seen: 13 years 2 months ago
Posted on August 3, 2010 at 5:26am
u can use sql query for sum in your report query.
Joined: Nov 19 2008 - 1:52am
Last seen: 8 years 9 months ago
Posted on August 3, 2010 at 5:28am
I have tried but It didn't work, and I tried to use multiple queries but it took only the first one :S
Joined: Jul 19 2010 - 11:30pm
Last seen: 13 years 2 months ago
Posted on August 6, 2010 at 2:03pm
just create a variable and set the properties
for caluculation --sum
and for variable Exp--put the if condition
let me know if it works
Joined: Jul 16 2010 - 5:48am
Last seen: 13 years 2 months ago
Posted on August 7, 2010 at 3:32am
thx for your reply.
I reanalized my SQL Query and managed to simulate the formula in SQL, and I imported the calculated values into my report, and it worked.
Thank you again,
Regards
Joined: Jul 19 2010 - 11:30pm
Last seen: 13 years 2 months ago