Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
sivarajs
Specialist II
Specialist II

Standard deviation in script

Hi,

I want to calculate standard deviation in script

currently am trying the following

load stdev(fieldname) as fieldname1

from x.qvd group by fieldname;

But am not getting any values in fieldname1

Anyone temme how to do standard deviation in script

Hope its clear... need your suggestions

Thanks

Sivaraj S

3 Replies
SunilChauhan
Champion
Champion

you can use

load stdev(sum(fieldname)) as fieldname1

from x.qvd group by fieldname;

or

see the example below.

it showing me 100 as stddev.

tab1:

Load * inline [

fieldname1,fieldname2

A,100

B,200

c,300

];

load stdev(fieldname2) as fieldname1,

1 as junk

resident tab1;

drop table tab1;

Hope this helps

Sunil Chauhan
sivarajs
Specialist II
Specialist II
Author

Hi sunil,

using sum with stdev showing error as nested aggr not allowed

Not applicable

Hi,

you can do that with following code (just skip group by clause from statement in your first post)

STANDARD_DEVIATION:

load stdev(fieldname) as fieldname1 from x.qvd;

regards