Entering content frame

Procedure documentation Selecting Fields - Count Locate the document in its SAP Library structure

Use

Use this screen to select the fields upon which to base your query. You may select fields from different tables in your data service. There is no limit to the number of fields you may select.

Selecting fields determines which fields will be displayed in the result. For the Count template, the order in which you select the fields is also important because it determines grouping (see Example, below).

 

Procedure

...

       1.      In the Available Tables and Fields section, locate and select a field.

This section lists the data service you chose on the Select a System screen as the root node of a tree, followed by any catalogs contained in that service.

                            a.      Expand a catalog to see a list of schema in that catalog.

                            b.      Expand a schema to see a list of tables in that schema.

                            c.      Expand the table that contains the field you want, and click to select the field.

       2.      Click à to transfer the field to the Selected Fields list.

       3.      Add additional fields from the same or from different tables, or remove fields as desired.

¡        To add all fields in a table to the Selected Fields list, select the table and click à.

¡        To remove a field from the Selected Fields list, select the field and click ß.

¡        To remove all fields from the Selected Fields list, click Clear.

       4.      Click Next.

 

Result

You proceed to the Configure Joins screen.

This graphic is explained in the accompanying text

To configure joins, you must select fields from two or more different tables. If you have selected fields from only one table on this screen, the wizard bypasses the Configure Joins screen and you proceed to the Configure Filters screen.

 

Example

You want to know how many employees each manager is responsible for, and how many are part-time or full-time employees. To find out, you use the Count template and select the Manager field, and then the Type field from the Employees table. This query counts all occurrences in groups, with one group per selected field.

The result of such a Count query is a table such as the below:

 

Count Query Result: With Grouping

Manager

Type

Count

Miller

Full-time

38

Miller

Part-time

3

Jackson

Full-time

10

Jackson

Part-time

1

Sullivan

Full-time

16

 

Note that the order in which the fields appear in the Selected Fields list is important. The results are first grouped by the first field, then by the second field, and so on.

If you had first selected Type and then Manager from the Employees table, the order of the columns above would be reversed, grouping the result first by employment type, then by manager, as in the table below:

 

Count Query Result: With Grouping

Type

Manager

Count

Full-time

Miller

38

Full-time

Jackson

10

Full-time

Sullivan

16

Part-time

Miller

3

Part-time

Jackson

1

 

This graphic is explained in the accompanying text

For the description, sample business questions, and process flow of working with the Count template, see Count (Relational).

 

 

 

Leaving content frame