perez08_erich Posted February 3, 2015 Share Posted February 3, 2015 Hi I am new in this and i would like to ask how to produce annual Growth rate using crosstab?to make it simple ,in my database it contains the Year, Item,quantity like this:YEARITEMQUANTITY2014Book 352014Pencil562015Book672015Pencil50 now in my report query i filtered it by "YEAR". By creating crosstab i produced something like this: $F{Year}Total Quantity Measure$F{Item}$V{Quantity_measure}$V{Quantity_measure} which shows something like this 20142015TotalBook3567102Pencil5650106 I want to calculate the annual growth rate but cant manipulate the datas by Year as it only produces the total of both years, is there any way i can use the formula for annual growth rate in crosstab?Can anyone give me a sample template or any info on how to do it? Thank you very much. I want to produce a report output like this: 20142015Growth RateBook356791.42%Pencil5650-10.71% Link to comment Share on other sites More sharing options...
calculate.machine Posted April 17, 2015 Share Posted April 17, 2015 The problem involves inter-column calculation which Jasper has some difficulty in dealing with.Suggest using esProc to first prepare the data source and calculate and the growth rate:A1=mydb.query("select * from store order by item,year")A2=A1.group(item).run(A1.record(["Growth Rate",item,~(2).quantity/~(1).quantity-1]))Code explanation is available from http://blog.raqsoft.com/?p=3517. 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