cancel
Showing results for 
Search instead for 
Did you mean: 

Calculating Mean using SQ01 Query

Former Member
0 Kudos

I have a query that is looking at the duration of time it take to quote. It is based on an Infoset that looks at two custom filed in VBAK.  I calculate the duration as an additional field in the Infoset.  When the report runs, I want to also display the mean of the quote times on the subtotal line.  Is there a way to do this?  I have been looking at statistic section and have tried a few things, but I am not getting the results I want.

Do not want to have to send this report to a developer as it will take awhile before they are able to get to it.

Thanks for any assistance.

Accepted Solutions (1)

Accepted Solutions (1)

andrea_brusarestelletti
Active Contributor
0 Kudos

Hello,

  do you need the mean value,  for the values of a column, or the mean value between two different fields of the same record?

In the first case, run the query with output in ALV mode, highlight your column, then press the black arrow on the bottom right side of the "Sum" button and select "Mean value".

Best regards,

Andrea

Former Member
0 Kudos

Thanks Andrea

Your first assumption is correct, I need the mean value of the column.  When I highlight the duration column and the click on the sum button to get mean i receive an error message

Desired Operation Cannot be Performed for column, Duration.  I have searched for a solution, but all of them have to do with adding or changing ABAP code. Have not seen anything on when you are creating the ALV from SQ01.

former_member253400
Participant
0 Kudos

Hi John,

Most probably you got this error because you use data type CHAR or NUMC for the field 'Duration' for which it is impossible to calculate the mean value.

Try to specify the correct data type for ypur field (e.g. DEC).

I hope it's help

KR,

Sergey

former_member205178
Contributor
0 Kudos

Hi,

What did you maintain as the Data Type for "DURATION" Data Element here ?? If it is CHAR you might want to change it to NUMC or QUAN and then try what Andrea as suggested.

Thanks.

Answers (2)

Answers (2)

Former Member
0 Kudos

Thank you all for your assistance.  I did not have the duration filed configured correctly. Once I change it to decimal it seems to work the way I expected.  Still have some minor issues, but getting this answered was a huge help

former_member184701
Active Contributor
0 Kudos

in your InfoSet (SQ02) you can add some simple abap code to count a sum (of course,if you understand abap) - look at Extras.

you don't need to go to abaper and don't need to have a developer key.

modify your infoset and adjust your query.