Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

how to code a percent change on a group summary?

Posted on 2008-10-07
4
Medium Priority
?
669 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
2 Comments
 
LVL 101

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 35

Accepted Solution

by:
James0628 earned 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem Statement In an SAP BI BO Integration project when a BO universe is built on a BEx query, there can be an issue of unit & formatted value objects not getting generated in a BO universe for some key figures. This results in an issue whereb…
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Suggested Courses

824 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