Calculated measure issue....!!

Hi community,

i want to create a calculated measure my requirement  is if condition is satisfied then add 100 in sum of that particular column.

so tried formula like this but its not working aggregated value is coming  

if("condition", column_name +100,column_name)

even i tried if("condition", Sum(column_name) +100,Sum(column_name))

summary calculation what i have to write to get proper value.

please suggest me.

thanks in advance 

Anshul

 

anshulbhatt90's picture
Joined: Jun 2 2014 - 11:27pm
Last seen: 8 years 7 months ago

1 Answer:

Hi Anshul, 

I am assuming here that you already have a report which has a Variable which Calculates the Total of a column. 1) edit the Variable Expression and add something like this.(Here I have created a report with Sample DB in Jaspersoft Studio and created a Group on SHIPCOUNTRY. and then dragged the column TOTALORDER variable on to Group footer and selected Sum as my calculation, this created a variable TOTALORDERS1. and I Manually created TOTALORDER2 and added the below expression) 

IF(EQUALS($F{SHIPCOUNTRY},"Argentina"),SUM($V{TOTALORDERS1}.doubleValue(),100),$V{TOTALORDERS1}.doubleValue()) Now For further explanation. Check the Report here.

https://www.dropbox.com/s/atidrkzvjuo2sds/ColumnsOnASumCondtion.rar

Thanks,

Rajesh Sirsikar

For more tips tricks check http://www.rajeshsirsikar.com

rajesh.sirsikar's picture
Joined: Apr 21 2014 - 5:43am
Last seen: 5 years 5 months ago
Feedback
randomness