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
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