Solved

how to code a percent change on a group summary?

Posted on 2008-10-07
4
655 Views
Last Modified: 2013-11-15
I am reporting for a bank on deposit history.  I have the total deposits broken into the following groups:

Region
Deposit Group (ie ck, sav, cd, etc)
Date (I have selected records for end of month)

Total deposits are reported for each end of month period for each deposit group for each region by using a running summary on the detail level, which is the month end account balance of each account.  I would like to calculate a percent change on each period to graph.  

A previous post on reporting percent change gave the following code:

shared numberVar LineCount;
LineCount := LineCount + 1;
If LineCount = 1 then
   0
Else
   (
   if Previous({fieldname}) = 0 then
      0
   else
      ({fieldname}- Previous{fieldname})) / Previous({fieldname})
   )

This code works if it is a database record, but it doesn't like the summary operation I am using.  It reports:

"This Field has no previous or next value."

Thanks for any assistance!
0
Comment
Question by:Rilken
4 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 22665711
You can check if OnFirstRecord before using Previous.

Crsytal also has a PreviousIsNull test you can use.

mlmcc
0
 
LVL 34

Accepted Solution

by:
James0628 earned 500 total points
ID: 22674513
If you're saying that you're trying to use Previous () on a summary or running total, instead of on a field, then, as CR said, you can't do that.  Unless I'm mistaken, Previous () only works on fields in your datasource, or formulas that reference fields.  Assuming that I'm correct about what you're trying to do, I think you're going to have to do this another way.

 You say that you have three groups and the last one is Date.  Is that your "period" group?  So, you're looking for the % change in some total for the Date (period) group, between one "period" and the next in the "Deposit Group" group?

 If so, you'll probably need to use a formula in the Date group footer that will save the total at the end of each "period" in a variable and compare the current total to a variable containing the total from the previous "period" (if any).

 You also mentioned that you wanted to graph the % change.  Do you want to do that in the report, or are you just trying to get the %'s on the report, and then you'll copy those and use them somewhere else to produce a graph?

 James
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
How to increase the row limit in Jasper Server.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now