venkateshreddy080 Posted May 4, 2016 Share Posted May 4, 2016 Dear Team, Can you please let me know How to find the difference/variance between previous and current row value in detail band?I created variable with calculation type as Variance and placed this variable in detail band, but it is not giving the correct variance b/w previous and current row values.Please let me know the steps to solve this issue. ThanksVenkatesh Link to comment Share on other sites More sharing options...
zh3ntil Posted May 6, 2016 Share Posted May 6, 2016 Hi,You can achive this by using 3 variable. For example create variable like below. Sort is important. Beacuse jaspersoft calculates the variable by orders.vSalesCurr = $F{Sales}vSalesDiff = $V{vSalesCurr} - $V{vSalesPrev}vSalesPrev = $F{Sales} (you can define 0 as initial value)While jasper processing the vSalesDiff,vSalesCurr holds current value because it is calculated alreadyvSalesPrev holds the previous value because it is not calculated yet and still holds the previous value. That's the trick. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now