1
votes

I have a following employee table value as below : name | cost john | 1000 john | -1000 john | 5000

when we add the cost column total will be 5000. I need to print only the 3rd row in BIRT report, since the 1st and 2nd row get cancelled out each other.

I'm stuck at filtering the table for above scenario.

2

2 Answers

1
votes

Couldn't you just solve this using SQL like

  select name, sum(cost)
  from employee
  group by name
  order by name

?

Or do you just want to exclude two rows if they have exactly the same cost, but with different signs? Note that this is actually something different, take for example the three rows [ john|1, john|2, john|-3 ]? In this case, a pure SQL solution can be achieved using the SQL analytic functions (at least if you are using Oracle).

0
votes

Elaborate your question. Its not clear if these are columns or rows.

If These are columns:

  1. Create a computed column in your dataset
  2. In Expression builder of that column add/sub values using dataSetRow['col1'] and dataSetRow['col2']
  3. Add only that computed column to your table.

If these are rows

  1. Select rows you don't want to print
  2. Go to properties tab
  3. Find Visibility property and click on it
  4. Check Hide Element option