cancel
Showing results for 
Search instead for 
Did you mean: 

Finding average value

Former Member
0 Kudos

Hi,

how to find the average of array like (1,2,3,4)using bls?

Please give me the solution for this query.

points will be rewarded.

Thanks&Regards

Gurunadh.

Accepted Solutions (1)

Accepted Solutions (1)

jcgood25
Active Contributor
0 Kudos

There are several ways that you could get the average value, but the optimal way would depend upon the source of your array values?

Former Member
0 Kudos

Hi Jeremy

Thanks for your reply.Actually we will write a stored procedure and the output of the procedure would be a list of arrays like(1,2,3,4,5)(3,4,5,6,7) and so on.

our requirement is to find the average of each array and then find the minimum of these all averages.

Former Member
0 Kudos

Um, OK. Why don't you then use an Average function of the database?

jcgood25
Active Contributor
0 Kudos

Assuming you really don't need the individual values at all then I completely agree with Ryan - use the database and just query back the record/values you actually need.

Regards,

Jeremy

Former Member
0 Kudos

Do you need any further help on this?

Answers (1)

Answers (1)

sufw
Active Participant
0 Kudos

Hi Gurunadh,

you can use the Aggregate Statistics action block for this (under XML Functions in BLS editor) - it will give you average (mean) and a few other statistical values in one execution.

However, this action only works on numbers which are in one column.

This is also in the xMII help - http://help.sap.com/saphelp_xmii115/helpdata/en/Business_Logic_Services/aggregatestatistics.htm

Sascha