Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

std - sap function to calculate standart DEVIATION

Former Member
0 Likes
657

hi all friends ,

for example :

i have these numbers : 13, 8, 5, 2

so result std of this must be : 4.69

which sap function can i use to calculate and get this result ?

thanks to all,

avi

hi all friends ,

for example :

i have these numbers : 13, 8, 5, 2

so result std of this must be : 4.69

which sap function can i use to calculate and get this result ?

thanks to all,

avi

3 REPLIES 3
Read only

amit_khare
Active Contributor
0 Likes
577

Check Amit's Reply -

Regards,

Amit

Reward all helpful replies.

Read only

Former Member
0 Likes
577

try this code..

data : begin of it occurs 1,

num type p,

x_xbar type p,

end of it.

data : num1 type p value 10.

data : tot type p,l(2),

total type p. " E(x - mean)^2

data : mean type p.

data : var type p,

sd type p.

do 5 times .

it-num = num1.

append it.

num1 = num1 + 10.

enddo.

loop at it .

tot = tot + it-num.

endloop.

describe table it lines l.

mean = tot / l.

loop at it .

it-x_xbar = ( it-num - mean ) * ( it-num - mean ).

total = total + it-x_xbar.

endloop.

var = ( total ) / ( l - 1 ).

sd = SQRT( var ).

write : sd.

reward if it helps..

Regards,

Omkar.

Read only

Former Member
0 Likes
577

Use FM: RMMATH1_VARIANCE_DEVIATION