Jump to content

Recommended Posts

Posted

Hi!

I've made a crosstab that display sales by month and year. Now I need to calculate the differece against last years total. Any suggestion how to do this?

 janfebmar...TotalDifference last year
2012123213123412...111231 
2013123213213123...1231231??? (Total 2013 - total 2012)
201412321313213...123123??? (Total 2014 - total 2013)

 

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted

Hi Henrik,

Please follow the steps as below.

1) Create a Variable "Previous_Value" and in the expression Window write $V{Current_Value}.

2) Now Create Variable "Current_Value"  and choose the Field "Total"

3) Now Create the Diff Variable with Expression $V{Current_Value}-$V{Previous_Value}

The Trick here is to create Previous Value field first so that Jasper runs it first at the runtime.

Check My blog http://www.rajeshsirsikar.com/subtract-current-value-from-previous-value-in-jaspersoft-studio/ for Images and Info.

Please Up -Vote If you find this answer useful.

Thanks,

Rajesh Sirsikar

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...