Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Numbervar

Status
Not open for further replies.

marcyeager

IS-IT--Management
Jul 19, 2006
8
US
I am utilizing a Numbervar function in a report that i'm working on to create a running total of a formula.

I was wondering if it possible to use this function twice (or more) in the same report (same grouping as well). I am running a report that is summarizied by record number and there are multiple transactions per record number. I would like to be able to create a running total of a few different formulas.

Thanks in Advance, Marc
 
Numbervar is a variable, not a function.

Explain what you need to do showing example data and the expected output, your descriptions are vague.

Also including your software version and the database being used may provide other possibilities.

The poiunt is to post specifics.

-k
 
Sorry for the lack of specifics.

CR Version 11
Oracle Database

There are 2 Grouping the first is sorting by month and the second is sorting by salesman.

Current Numbervar variable formulas:
Running Total Fee Income = WhilePrintingRecords; NumberVar Amount := Amount + {@Fee Income};

Display Running Total = WhilePrintingRecords; NumberVar Amount

Reset Total (Located in Month Group Header)= WhilePrintingRecords; NumberVar Amount :=0

These formulas are calculating the total amount of fee income for each month. Because each record has multiple transactions, but only one fee income (which needs to be calculated) this was suggested as the best approach to come up with a total.

Now I would also like to add this same summary ability on a different formula which will be called (@4500 Total).

Again I really appreciate any help that can be offered.

Thanks, Marc
 
How do we what is going to be in @4500? The last thjing we need to know is what you want to call it, we need to know WHAT sort of aggregate it is and any conditions to be used.

Perhaps I'm in a bad mood today but the posts seem to be intentionally vague... have something that needs to be summed, you can place it in the detasils, right click it and select Insert->Summary and select the group for it to be summed in.

If it requires a condition, then add it to your reset formula in the group header and filter the condition, as in:

WhilePrintingRecords;
NumberVar Amount:=0;
NumberVar Amount2 := 0;

Then in the details create another formula:
WhilePrintingRecords;
NumberVar Amount2;
if {table.field} = "some value" then
Amount2:=1
else
Amount2:=0

Then you can display in the group footer:

WhilePrintingRecords;
NumberVar Amount2 := 0;

If you don't understand what the original formula created is doing, think of it this way.

A group is a loop, so we set a variable to zero at the start.

The details are looped through until the group changes, so any formulas within will fire for those conditions.

When the current group value completes, you're in the group footer, so you can dispolay that iteration of details values.

Then it starts again with the next group value, or if they are done, the next outer group will begin.

-k
 
Ooops, messed tht up, sorry.

The display would be:

sum({@amount2},{table.group})

Or you can just right click it and select insert summary for whateve group you want it in.

-k
 
Thanks for the responses your previous post solved my issue. I do appreciate your help. Marc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top