Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Running Total based on Specific Order of Group.

Posted on 2014-04-08
4
Medium Priority
?
260 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 101

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 101

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 35

Accepted Solution

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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

688 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