How to use lag functions in jasper

0

Hello,

  I want to create a table something like this,

A                      B         C             D                E

 Jan                 0          2             1         A+(B-C) = 1

Feb                  1          4            3          1+(4-3)=2

Mar                  2          6            5        2+(6-5) =3

Apr                  3   . . .


first row ,Second column  value should always zero, and last column last value should be displayed as second row second column second value. and should be repeted until end of the table, Is their any way to acheive this in jasper, If so Please help!!!

udaysriturangi's picture
Joined: Oct 18 2016 - 9:31pm
Last seen: 2 years 6 months ago

Why don't you handle this in query?

m.imran.tariq - 2 years 9 months ago

1 Answer:

0

Hi imran,

In query, i am using lag function, so that i am able to get last row last column data in second row, But it is not allowing me to do calculation saying nested window functions are not allowed,It is just simply printing previous row value.


my table data:

January       0                        55019.17      221         242                  0    54556.17
February      54556.17         32139.07      20          5967115.32    0    -5934996.25
March         -5934996.25    18026.1          493       0                      380    17153.1
April             17153.1            0                       6           0                       0    -6


Thanks ,

Udaya.
 

udaysriturangi's picture
Joined: Oct 18 2016 - 9:31pm
Last seen: 2 years 6 months ago
Feedback