cancel
Showing results for 
Search instead for 
Did you mean: 

Group By Operator and statistics operation

Former Member
0 Kudos

Hi all,

in my model from the data service I obtain these fields

sold_to (T)

delivery_date (D)

quantity (N)

zdiff_date (N)

zindex (N)

I have to present a table where I have a row for each SOLD_TO and in the columns I'd like to show the average values.

So the situation should be:

sold_to | quantity (AVG) | zdiff_date (AVG) | zindex (AVG).

For this I use the Group by operator where on SOLD_TO field I apply the Group1 and for the others fields I use the average operation.

My problem .... I don't see the results..... all the average fields are empty but if I apply the sum (for instance) I obtain the right results.

Where is the problem? Have you ever seen or tested this kind of situation?

Regards, Roberto

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi

Only Group operator is not sufficient. In your case -

1. If you apply 'Group'1 on 'Sold_To' then you also need to apply 'Total' on the key figure (Say - Quantity). You will get both options in 'Group' operator itself.

2. There is another method you can use filter operator & diplay only result row.

Regards

Sandeep

Former Member
0 Kudos

Hi Sandeep, thank you for the answer but I don't undestand very well the point 1 and the total on the key figure q.ty.

The average should be calculated on several fields (not only q.ty)

Other informations: My Data service is a RFC FM where the export is a table.

Thank you, Roberto

Former Member
0 Kudos

Hi Roberto,

if you want to calculate avg for all the fields then select the characteristic and for that select group1 and for all key figures which you want to do average select average from the dropdown.

Regards,

Rk.

Former Member
0 Kudos

Hi

Follow the steps to use 'Group Operator' -

1. Right click on the group operator & go to configure element.

2. Select the field which you want to group (where you want total or avg)

3. Got in the next column (Sigma) & select 'Gourp1' for all that fields. Do same for Key & Ext_Key also.

4. Then go to the field which you want to add or you want Avg.

5. Then again go to the 'Sigma column' for that & select operator 'SUM or AVERAGE'

6. Then you will get the required output.

Regards

Sandeep

Former Member
0 Kudos

Hi,

I applied your suggestion but doesn't work for the AVG. Only for the total (SUM).

I have these records in input:

SOLD_TO | DELIVERY_DATE | QTY | DIFF_DAYS | INDEX

0000102004 | 02.01.2008 | 1500 | 7 | 0,00467

0000102004 | 05.02.2008 | 1500 | 91 | 0,06067

0000102004 | 05.29.2008 | 17,010 | 27 | 0,00159

Group By Operator:

SOLD_TO (GROUP1)

DELIVERY_DATE (NONE)

QTY (AVG)

DIFF_DAYS (AVG)

INDEX (AVG OR STDDEV)

The results is

SOLD_TO | QTY | DIFF_DAYS | INDEX

0000102004 | | |

But if apply the following Sigma for the Group by operator

Group By Operator:

SOLD_TO (GROUP1)

DELIVERY_DATE (NONE)

QTY (SUM)

DIFF_DAYS (SUM)

INDEX (SUM)

The results is

SOLD_TO | QTY | DIFF_DAYS | INDEX

0000102004 | 20,010 | 125 | 0,06693

Only with the total it seems to work.

Regards, Roberto

Former Member
0 Kudos

Hi

Apply 'GROUP1' on 'Delivery Date' & then apply 'SUM' & 'AVERAGE' as you want. Then check the output you should the required result. 'Sigma' operator will not work for 'AVERAGES'. So you have to use 'GROUP' operator only.

Regards

Sandeep

Former Member
0 Kudos

Sandeep,

sorry but the average on Group by doesn't work. If there isn't solution I'll open a message to SAP.

GroupBY operator has GROUP1 for SOLD_TO and DELIVERY_DATE and for the other fields only the SUM I'm able to see.

If I apply the AVG I cannot see the results.

Only a thing when you say: "'Sigma' operator will not work for 'AVERAGES'. So you have to use 'GROUP' operator only.

". Why?

Regards, Roberto

Edited by: Roberto Fattore on Sep 11, 2009 11:45 AM

Former Member
0 Kudos

Hi

Drag one more 'Group Operator'. There select 'GROUP2' for the same field (SOLD_TO) & then apply 'AVERAGE' operator on required 'Field'. When you select 'GROUP1' you can define only one function (Sum or Average) after creating such groups you can use 'Combine Operator' to combine all the groups.

Regards

Sandeep

Former Member
0 Kudos

Hi Sandeep,

I tried to apply your suggestions without results. Probably I didn't apply correctly the operator.

May we start with a simplier example:

FIeld | Value

A | 10

A | 20

B | 5

The result should be:

Field | Value (AVG)

A | 15

B | 5

1) Output of the data service I attach a "Group by" operator: for the "FIELD" the SIGMA is GROUP1 and the "VALUE" the SIGMA is AVG

2) Output of the "GROUP BY" I attach the SIGMA operator: for the "VALUE" I apply AVG.

3) Output of the "SIGMA" I attach the result table ... but here I don't see nothing ... there is only a value for the "FIELD" that is "B"

Where is the error?Regards, Roberto

Former Member
0 Kudos

Hi,


FIeld | Value
A      | 10
A      | 20
B      | 5

The result should be:
Field | Value (AVG)
A     | 15
B     | 5

If you want the result as in the second table from the data in the first table do the following things.

step1: Connect data service to a "Group By" Operator.

Step2: In the Configuration of "Group By" Select "GROUP1" against Field and AVERAGE against Value.

Step3: Connect the out port of the "Group By" operator to the Table View.

Deploy and run the model, you will the get as in the second table above.

Regards,

Rk.

Former Member
0 Kudos

Hi there,

I have the same problem. Since we have EHP1 SP6, Average in Group By - Operator doesn't work anymore. Is there now a solution?

Thanks.

Best regards

Stephan