cancel
Showing results for 
Search instead for 
Did you mean: 

Supress section based on formula from lower sections/groups.

Former Member
0 Kudos

Let's say I have a formula that does a simple subtraction in group footer 3.

My goal is to suppress the sections for groups 1, 2 and 3 everytime {@SimpleFormula} is a negative number. So I used this section supression formula:

if {@SimpleFormula} >= 0 then false
else
true

Now this obviously works for group 3 because the formula pertains to it. But it does not seem to work for groups above 3...

What's a good workaround for this situation?

Edited by: Eric Choi on Oct 8, 2008 5:51 PM

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

you can use it because it is being evaluated at a later time.

within the formula {@SimpleFormula} >= 0 that indicates what is greater than zero, such as invoice amount etc?

Former Member
0 Kudos

Hi Sharon.

I'm not exactly sure what you may be asking but as far as @SimpleFormula goes, all it does is subtract two running totals.

@SimpleFormula contains:

{#UnderUtilCount} - {#OverUtilCount}

Former Member
0 Kudos

so the formula needs to be >0.00

so in the section expert i would place

if {#UnderUtilCount} =0.00 or

i{#OverUtilCount} =0.00 then true

this should supress it

Former Member
0 Kudos

Sharon,

I'm not sure that the formula you stated would work as it would only suppress when #UnderUtilCount or #OverUtilCount is 0... which is not my what I'd like.

The goal I'm trying to get is, in group 3, @SimpleFormula (#UnderUtilCount - #OverUtilCount) is calculated and displayed. If, calculation of @SimpleFormula turns out to return a value that is a negative number, then, I want groups 1 and 2 to be completely suppressed along with group 3.

I think the main trouble with my original formula is that it works... but Crystal doesn't quite know what to do when there are multiple group 3's that have both positive and negative results.

Let's say Group 1 = Location, Group 2 = Team, Group 3 = Cars.

Without suppression:

G1: New York
  G2: Team A
    G3: @SimpleFormula = -1
  G2: Team B
    G3: @SimpleFormula = -1
    G3: @SimpleFormula = 5

With suppression:

G1: New York
  G2: Team A
  G2: Team B
    G3: @SimpleFormula = 5

It does not suppress G2 (Team A) for some odd reason.

Or in another instance

Without suppression:

G1: Los Angeles
  G2: Team A
    G3: @SimpleFormula = -1
    G3: @SimpleFormula = 4
    G3: @SimpleFormula = -5
  G2: Team B
    G3: @SimpleFormula = -1
    G3: @SimpleFormula = 5

With suppression:

G1: Los Angeles
    G3: @SimpleFormula = 4
  G2: Team B
    G3: @SimpleFormula = 5

It does what it supposed to do technically (removes G3 items that are negative) but also suppresses G2 (Team A) for some reason... this is why I think it has no idea what to do with G2 that contains multiple G3s with negatives and positives.

I hope I'm making sense.

Former Member
0 Kudos

After testing I'm fairly convinced that the suppression formula is only evaluated based on the first subgroup-level it sees.

In other words, Group 2's suppression would really depend on whether or not the first instance of Group 3 is a postive or negative. If the first instance of Group 3 is a positive, it will not suppress Group 2. So technically, it does what the suppression tells it to do but there is a problem when there's multiple Group 3's with mixed positive and negative numbers.

If Group 3 has 3 items showing in the order of negative, postive, negative, Group 2 will look at the first negative of Group 3 and suppress itself. Unfortunately, then that means on the actual report, it will suppress Group 2 but show just the positive instance of Group 3 without a Group 2 instance.

How can I rewrite this suppression formula so it evaluates all the items under Group 3? Is this even possible?