Solved

Running Total based on Specific Order of Group.

Posted on 2014-04-08
252 Views
GF3 is a specified group with OTHERS being labeled as NON....

in the RH I have

WhilePrintingRecords;
Shared NumberVar NONDISTRICTTAX:=0

in the GF3 I have

WhilePrintingRecords;
Shared NumberVar NONDISTRICTTAX:=
IF GroupName ({@@City}) LIKE 'NON*' THEN Sum ({BV_vwrpt_SalesTax.TaxableValue1}, {@@City})
ELSE 0

in the RF I have

WhilePrintingRecords;
Shared NumberVar NONDISTRICTTAX:=NONDISTRICTTAX;

Why cant I get a grand total of only the Like 'NON*' as indicated above?
0
Question by:Mikeyman_01
• 2

LVL 100

Expert Comment

ID: 39987378
You can't use a summary on a summary function.  Also you have WhilePrintingRecords in the formula which forces the evaluation to be after the summaries are calculated.

You should be able to use a formula like and then summarize it.

``````IF GroupName ({@@City}) LIKE 'NON*' THEN
{BV_vwrpt_SalesTax.TaxableValue1}
ELSE
0
``````

mlmcc
0

Author Comment

ID: 39987388
Gives me zero's
0

LVL 100

Expert Comment

ID: 39987785
Are you grouping on City?

Try

IF ({@@City}) LIKE 'NON*' THEN
{BV_vwrpt_SalesTax.TaxableValue1}
ELSE
0

mlmcc
0

LVL 34

Accepted Solution

James0628 earned 500 total points
ID: 39988338
I think the problem is simply that you're not _adding_ to the variable.

You have

Shared NumberVar NONDISTRICTTAX:=
IF GroupName ({@@City}) LIKE 'NON*' THEN Sum ({BV_vwrpt_SalesTax.TaxableValue1}, {@@City})
ELSE 0

That will set the variable to the total from each group, so you just end up with the total from the last group.

If you want to accumulate a total for all of the groups in the report, it should be

Shared NumberVar NONDISTRICTTAX:= NONDISTRICTTAX +
(IF GroupName ({@@City}) LIKE 'NON*' THEN Sum ({BV_vwrpt_SalesTax.TaxableValue1}, {@@City})
ELSE 0)

And, FWIW, I would change your final formula slightly.  You have

Shared NumberVar NONDISTRICTTAX:=NONDISTRICTTAX;

That just sets the variable to itself, which doesn't do any harm, but it doesn't do any good either.  You could just use

Shared NumberVar NONDISTRICTTAX

James
0

Featured Post

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…