Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Formula field reporting period Post Reply Post New Topic
Author Message
llee-david
Newbie
Newbie
Avatar

Joined: 03 Mar 2011
Location: United States
Online Status: Offline
Posts: 3
Quote llee-david Replybullet Topic: Formula field reporting period
     Posted: 03 Mar 2011 at 10:39am
I'm trying to create a consolidating trial balance in Crystal Reports version 11, accessing the data through Lawson database tables. I would like to create a formula field for 15 months, for the periods Jan 1, 2010 through Mar 31, 2011. How do I create the formula since it crosses over two years?

Here is an example of the formula used to report for 12 months ending Dec 31, xxxx.  I would like to add 3 months of the next year to it.

Thank you!

({GLAMOUNTS.CR_BEG_BAL}+{GLAMOUNTS.DB_BEG_BAL}+
{GLAMOUNTS.CR_AMOUNT_01}+{GLAMOUNTS.DB_AMOUNT_01}+
{GLAMOUNTS.CR_AMOUNT_02}+{GLAMOUNTS.DB_AMOUNT_02}+
{GLAMOUNTS.CR_AMOUNT_03}+{GLAMOUNTS.DB_AMOUNT_03}+
{GLAMOUNTS.CR_AMOUNT_04}+{GLAMOUNTS.DB_AMOUNT_04}+
{GLAMOUNTS.CR_AMOUNT_05}+{GLAMOUNTS.DB_AMOUNT_05}+
{GLAMOUNTS.CR_AMOUNT_06}+{GLAMOUNTS.DB_AMOUNT_06}+
{GLAMOUNTS.CR_AMOUNT_07}+{GLAMOUNTS.DB_AMOUNT_07}+
{GLAMOUNTS.CR_AMOUNT_08}+{GLAMOUNTS.DB_AMOUNT_08}+
{GLAMOUNTS.CR_AMOUNT_09}+{GLAMOUNTS.DB_AMOUNT_09}+
{GLAMOUNTS.CR_AMOUNT_10}+{GLAMOUNTS.DB_AMOUNT_10}+
{GLAMOUNTS.CR_AMOUNT_11}+{GLAMOUNTS.DB_AMOUNT_11}+
{GLAMOUNTS.CR_AMOUNT_12}+{GLAMOUNTS.DB_AMOUNT_12})
IP IP Logged
Keikoku
Senior Member
Senior Member


Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
Quote Keikoku Replybullet Posted: 04 Mar 2011 at 5:24am
If they are all stored in your DB, is there a reason why you can't simply add the corresponding fields to that formula?
IP IP Logged
llee-david
Newbie
Newbie
Avatar

Joined: 03 Mar 2011
Location: United States
Online Status: Offline
Posts: 3
Quote llee-david Replybullet Posted: 04 Mar 2011 at 11:05am
How do I add the corresponding fields for a different year to the existing formula?  The formula I have currently starts with the beginning balance of the year selected (such as 2010 from the parameter field), then adds the 12 periods for the year (Jan-Dec).  How do I add to the formula so that the system picks up the 12 periods Jan-Dec 2010, and also include periods Jan-Mar 2011?  Thank you for your assistance!
IP IP Logged
Keikoku
Senior Member
Senior Member


Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
Quote Keikoku Replybullet Posted: 06 Mar 2011 at 9:09am
I am assuming the formula in your first post is what is used to calculate the final balance.

I do not know how the data is stored in the DB, nor am I familiar with lawson DB, but it appears that it manually grabs the the value for each month.

Perhaps you can explain the fields that are used in the formula up there? I'm assuming GLAMOUNTS is the table and CR_AMOUNT_01 represents the crystal value for january, while DB_AMOUNT_01 represents the database amount for that month?

So then how do you determine which year it is?
IP IP Logged
llee-david
Newbie
Newbie
Avatar

Joined: 03 Mar 2011
Location: United States
Online Status: Offline
Posts: 3
Quote llee-david Replybullet Posted: 07 Mar 2011 at 2:38pm

The formula in the first post starts with the beginning balance from the GLAMOUNTS table (CR represents Credit and DB represents Debit - both are needed to include the positive and negative amounts to arrive at the beginning balance).  The remaining periods represent the corresponding month's credit and debit values.  CR_AMOUNT_01 & DB_AMOUNT_01 represent the credit and debit database amounts for Jan, respectively.

The year is selected via the parameter field - It is defined in the Record Selection under the Selection Formulas. 
 
Thank you for your help!  It is greatly appreciated.
IP IP Logged
Keikoku
Senior Member
Senior Member


Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
Quote Keikoku Replybullet Posted: 08 Mar 2011 at 2:44am
Ok.

How do you determine that CR_AMOUNT_xx is the value for the correct year?
For instance, {GLAMOUNTS.CR_AMOUNT_02} is the credit amount for february...but which one?

I think the issue is that you want to report periods greater than one year, but it doesn't seem very obvious how you can get the values for the other years.

I mean if it were explicitly stored then that's great but that doesn't seem to be the case

Edited by Keikoku - 08 Mar 2011 at 2:47am
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum