2 Replies Latest reply on Dec 2, 2011 8:13 AM by NaturSalus

# Summary or Calculation Field?

### Title

Summary or Calculation Field?

### Post

Hello,

I am developping a project that manages Deviations reports. So the basic structure of the DEVIATION table is the following:

__kp_Deviation

DeviationTitle

DeviationDescription

...

DeviationOrigin

DeviationSubject

...

The DEVIATION::DeviationOrigin field values are selected from the Deviation Origin value list.

The DEVIATION::DeviationSubject field values are selected from the Deviation Subject value list.

I am trying figuring out what is the best strategy to COUNT the number of records that have the same value for two fields: DEVIATION::DeviationOrigin and DEVIATION::DeviationSubject. The final purpose is to carry out basic statistical analysis and a graphical presentation of data.

For example,

There are 254 records that have the value: "Product Deviation" for the DEVIATION::DeviationOrigin

and those can be grouped as:

150 records that have the value: "Finished Product" for the  DEVIATION::DeviationSubject field

100 records that have the value: "Intermediate Product" for the  DEVIATION::DeviationSubject field

4 records that have the value: "Raw Materials" for the  DEVIATION::DeviationSubject field

For example,

DEVIATION REPORT

Deviation Origin: DEVIATION::DeviationOrigin. Total Deviation Origin:

Deviation Origin: Product Deviation. Total Deviation Origin: 254

Deviation Subject: DEVIATION::DeviationSubject. Total Deviation Subject:

Deviation Subject: Finished Product. Total Deviation Origin: 150

Deviation Subject: Intermediate Product. Total Deviation Origin: 100

Deviation Subject: Raw Materials. Total Deviation Origin: 4

Which fields (calculation or summary) do I need to create to keep tract of the number of records with a particular value for fields  DEVIATION::DeviationOrigin and DEVIATION::DeviationSubject?

Thanks,

natursalus

• ###### 1. Re: Summary or Calculation Field?

A summary report created on a layout based on your Devation table would seem to be simplest to set up.Calculation fields from a related table could be use with aggregate functions such as sum, but that doesn't look like the best approach here.

Define a Count of type summary field in the deviation table and set it to "count" a field that is never empty so that it will count records for you.

Put a sub summary layout part on your layout, "when sorted by DeviationOrgin". Put the DevationOrigin and this summary field in this layout part.

Put a second sub summary layout part on your layout, "when sorted by DevationSubject". Put the DeviationSubject and this same summary field in this layout part.

Remove the body layout part.

Now you should have your report. Perform a find for the records you want in your report, then sort them first by Devation Origin, then by deviation subject. Use View as list to view this report and you should see the counts you've described here.

• ###### 2. Re: Summary or Calculation Field?

Hello Phil,

Many thanks for the directions, I appreaciate your help.

natursalus