Solved

Running Total based on Specific Order of Group.

Posted on 2014-04-08
4
253 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
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…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

863 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

25 Experts available now in Live!

Get 1:1 Help Now