Solved

Running Total based on Specific Order of Group.

Posted on 2014-04-08
4
252 Views
Last Modified: 2014-04-11
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
Comment
Question by:Mikeyman_01
  • 2
4 Comments
 
LVL 100

Expert Comment

by:mlmcc
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

Open in new window


mlmcc
0
 

Author Comment

by:Mikeyman_01
ID: 39987388
Gives me zero's
0
 
LVL 100

Expert Comment

by:mlmcc
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

by:
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

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…

757 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

19 Experts available now in Live!

Get 1:1 Help Now