I have following data set in oracle table and want to generate CSV file from that data.
My data
CaseID Amount 1000 10 1000 20 1000 50 2000 30 2000 10 3000 30 3000 20 3000 20
It is necessary to show the following output from above data.
Required Output
CaseID Amount Aggregate 1000 10 1000 20 1000 50 80 2000 30 2000 10 40 3000 30 3000 20 3000 20 70
Aggregate column is populated by accumulating the sum of Amount according to caseID group.
Group summary should display on last element of the group. But not in the next row, should display in the same row and next column, that matching with the last element.
I tried with 'Print When Expression' for other scenarios, but unable to use with this scenario. Also I have find similar questions, but not cater with this requirement. So would like to know the possible solutions for this.
You can do something similar with evaluationTime="Auto". You can have a text element that shows the value on the last record in the group and is empty for other records. It's not the same as not printing the element at all, but you can't use the print when expression because it doesn't have delayed evaluation.
evaluationTime="Auto" uses the reset types of variables to decide the moment at which it reads the variable values. Each group has an automatically created count variable that resets with the group, and if you create a new variable that resets on each record you can use it to determine if the current record is the last record in the group.
The whole report would look something like this