Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Standard deviation

Hello,

I have a only one table with one row:

LOAD * INLINE [

    ITEMID, INVENTLOCATION, DATE, sales

    026381, Ł1, 2013-Mar, 1

];

I want to create table with calculation of standard deviation:

dimension: ITEMID,INVENTLOCATION

expression: =stdev(aggr(sum(sales),INVENTLOCATION, DATE))

Why field of this expression is empty?

1 Solution

Accepted Solutions
Clever_Anjos
Employee
Employee

Standard Deviation calculation needs at least two values

R9uX5.png

If you have only one value, you´ll have 0/0 that is undefined

View solution in original post

8 Replies
Clever_Anjos
Employee
Employee

Standard Deviation calculation needs at least two values

R9uX5.png

If you have only one value, you´ll have 0/0 that is undefined

Not applicable
Author

the same result with this script:

LOAD * INLINE [

    ITEMID, INVENTLOCATION, DATE, sales

    026381, Ł1, 2013-Mar, 1

    026381, Ł1, 2013-Mar, 1

];

Clever_Anjos
Employee
Employee

Again, you´re having only one value, since your INVENTLOCATION, DATE are the same, so your AGGR() will return only one value.

LOAD * INLINE [

    ITEMID, INVENTLOCATION, DATE, sales

    026381, Ł1, 2013-Mar, 1

    026381, Ł1, 2013-Abr, 1

];

will return "0", because your AGGR() will return 2 similars values

Not applicable
Author

Ok, I have problem with this. Why when I don't selected ITEMID expression =stdev(aggr(sum(sales),INVENTLOCATION, DATE)) is not calculated for all ITEMID. When I select only one ITEMID this expression is calculated?

Clever_Anjos
Employee
Employee

Could you post a sample of your app?

Not applicable
Author

In attachment

Clever_Anjos
Employee
Employee

If you use an AGGR inside an object that has dimensions usually those dimensions must be into your aggr expression.

Please check if this formula returns what you need

=stdev(aggr(sum(ilosczfak),ITEMID,INVENTLOCATIONIDLOG2, INVOICEMONTH))

Clever_Anjos
Employee
Employee

Please check #4 into Pitfalls of the Aggr function