1 2 Previous Next 17 Replies Latest reply on Feb 7, 2011 2:27 PM by philmodjunk

# calculation problem: dividing 2 summary fields in a sub-summary layout part

### Title

calculation problem: dividing 2 summary fields in a sub-summary layout part

### Post

Okay I have to summary fieds that I want to divide to get a percentage. They are sitting in the subsummary part of my layout, that is in list view. The summary fields alone work in the sub-summary part but when I make a field to divide the one by the other and place it into the sub-summary part. It gives me the same number down the entire page in every sub-summary. This is the calculation I am using.

sum_udbe_amount_achieved / sum_bid_amount

Thanks

• ###### 1. Re: calculation problem: dividing 2 summary fields in a sub-summary layout part

Yep, when you use summary fields in a calculation, they evaluate just as though they were not in the sub summary part. They return a "grand total" based on your entire found set. To use the sub totals as displayed in your sub summary part in your calculation, you have to use the GetSummary function.

GetSummary ( sum_udbe_amount_achieved ; BreakField ) / GetSummary ( sum_bid_amount ; BreakField )

Where BreakField is the "when sorted by" field designated in your sub summary part.

• ###### 2. Re: calculation problem: dividing 2 summary fields in a sub-summary layout part

Okay tried what was suggested but now I'm getting nothing in the field. What's going wrong?

GetSummary ( sum_udbe_amount_achieved ; PRIMES::prime_dba_name ) / GetSummary ( sum_bid_amount ; PRIMES::prime_dba_name )

• ###### 3. Re: calculation problem: dividing 2 summary fields in a sub-summary layout part

Is your found set sorted by PRIMES::prime_dba_name?

If it's not sorted by this field, you won't get a value returned.

• ###### 4. Re: calculation problem: dividing 2 summary fields in a sub-summary layout part

Thought I had it still nothing

• ###### 5. Re: calculation problem: dividing 2 summary fields in a sub-summary layout part

Yes, it is sorted by Primes::prime _dbe_name

• ###### 6. Re: calculation problem: dividing 2 summary fields in a sub-summary layout part

I'm assuming that you selected Sort Records... from the Records menu to make sure that you have sorted the records in an order that includes PRIMES::prime_dba_name  (make sure you are not using a different table occurrence of Primes here) to group your records by this related field's value.

If you put Primes::prime_dba_name directly in the body of your layout, do you see the value you'd expect for each group of records?

• ###### 7. Re: calculation problem: dividing 2 summary fields in a sub-summary layout part

Yes i'm using the correct table occurrence

If I place it into the body it does not work either

• ###### 8. Re: calculation problem: dividing 2 summary fields in a sub-summary layout part

If I place it into the body it does not work either

But can you see data in this field? Is the data you see that data that you would expect and is this data common to all the records in each group like it should? I asked you to try this to confirm that your relationship to Primes is a valid relationship.

• ###### 9. Re: calculation problem: dividing 2 summary fields in a sub-summary layout part

The relationship to the prime is through a jointable and it works fine. The field is completly blank no matter where I place it.

• ###### 10. Re: calculation problem: dividing 2 summary fields in a sub-summary layout part

Which indicates that it does not work at all for the purposes of your report. This isn't a value you can sort on until you either modify the relationship or find a different field on which to sort for the purposes of grouping your records.

• ###### 11. Re: calculation problem: dividing 2 summary fields in a sub-summary layout part

I this where in the editing the relationship I would have to click sort records box?

• ###### 12. Re: calculation problem: dividing 2 summary fields in a sub-summary layout part

Okay I'm getting it to work right now in the body just not the sub summary.

I chaged it to sort by contract number which worked but I need the subsummary part by prime_name and that doesn't work.

How would I make it to where I could still separate by prime_name?

• ###### 13. Re: calculation problem: dividing 2 summary fields in a sub-summary layout part

You'll have to find a way to sort by prime_name. As I don't know exactly how you've structured your tables, I can't really go into any details here.

• ###### 14. Re: calculation problem: dividing 2 summary fields in a sub-summary layout part

Could I make a field in the current table mirror the text in my Prime_name field? and then do a sort by that?

1 2 Previous Next