suppress subtotal records still accumulating

Hi All,

My report has two groups.

My running total evaluates then sums in Group 2.

whileprintingrecords;
numbervar RRGM2;

IF {@VII. ProjectComplete%} > .89 then
RRGM2 := RRGM2+{@VIII. RTD GmRow$ }

I have another subtotal in group 1. The group 1 total. It displays this ie

whileprintingrecords;
numbervar RRGM2;

The subtotal in group 1 sums records regardless of condition…
I would love to keep this from occurring.

Thanks in advance

Crystal 2008
SQL :hb: :hb:


dame (BOB member since 2007-07-30)

Suppressing just hides things (except for subreports). The calculations keep going. To keep from calculating, you need to put in the same condition as for the suppression into the formula so it does not calculate.

I hope this helps.


kevlray :us: (BOB member since 2010-06-23)

Also, I would change your formula to this:

whileprintingrecords;
numbervar RRGM2;

IF {@VII. ProjectComplete%} > .89 then
RRGM2 := RRGM2+{@VIII. RTD GmRow$ };
RRGM2

I’ve seen issues in the past with this type of formula where nothing is displayed if the most recent record does not meet the condition for the equation. Making the change to add the variable at the end will ensure that it will always show.

There is another option as well - use a Running Total instead of calculating this yourself. You would set the following in the Running Total Expert:

Field to Summarize: +{@VIII. RTD GmRow$ }
Type of Summary: Sum
Evaluate: On formula. The formula would be: {@VII. ProjectComplete%} > .89 and not (your suppression formula)
Reset: On change of group: your Group 1

-Dell


hilfy :us: (BOB member since 2007-04-16)

Thanks for the suggestions. I did follow them. No change…

Some detail:

The report has
G1 - Employee
G2 - Project

A sub report is used on G2 to calculate the percentage. I then suppress records greater than .90. The sum for those records are still totaling in G1.

Thanks for the responses thus far.


dame (BOB member since 2007-07-30)

Have you looked at the actual values being returned by the subreport? Are they in the range 0-1 or 0-100?

-Dell


hilfy :us: (BOB member since 2007-04-16)

The value returned for the project is a whole number. I then divide sub value against a sum field on G2 to get %.

ie

Sub report return value 10

G2 project% = 100/10

Then I start my evaluation.


dame (BOB member since 2007-07-30)

100/10 = 10. So, you’ve either posted an invalid example or you’ve switched the values in your formula in the report. From what you’ve shown, the logic should be (value from subreport)/(sum from group 2) if you’re looking for a number between 0 and 1.

-Dell


hilfy :us: (BOB member since 2007-04-16)

better example…

D Cost
G2 A Sub-report retrieving value for project
G2 B project 1 sum of cost is 100 p is .80 = calculation cost 100/value
G2 B project 2 sum of cost is 80 p is .75 = calculation cost 80/value
G2 B project 3 sum of cost is 20 p is .95 = calculation cost 20/value

my rte
whileprintingrecords;
numbervar RRGM;
if pt < .90 then RRGM:= RRGM+Cost
RRGM

on drill total G2 = 180
main G1 = 200

Although in my condition states not to sum.

Thanks


dame (BOB member since 2007-07-30)

Ok, so what I see you saying is that the numbers are correct when you drill down into Group 2 but not when you sum them at the Group 1 level. Is that correct?

What is your sum for Group 1?

-Dell


hilfy :us: (BOB member since 2007-04-16)

G1 on drill 180
G1 on main 200

Not sure why while drilling on G2 the G1 sum is 180 (correct) however on main (no drill) G1 is 200. Any explanation would be greatly appreciated. Even if its not possible.

Thanks


dame (BOB member since 2007-07-30)

<Bright Lightbulb goes off!>

The subreports don’t run until you open the drill-down. So, your percentage is 0. Since 0 < .89, all of the values are summed. So, you’re not getting the correct info because some of it is based on the subreport. Because of this, you probably won’t be able to do what you’re trying to do.

-Dell


hilfy :us: (BOB member since 2007-04-16)

To conclude.

I modified the underlining view. A union all to retrieve my amounts to determine %. Then modified report selection criteria as well as column conditions.

I used running total on subtotals and grand totals.

Woks perfect. Finally had sometime to think about it.

Learned some new tricks…

I appreciate everyones assistance.
Thanks


dame (BOB member since 2007-07-30)