Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

using stdev in script

Hi All,

I have got stdev working as an expression in a chart but with 700 elements in the dimension (used in a trellis chart) and thousands of values across 4 years, it is slow to refresh.

I don't believe this is optimal (or smart) use of QV and want to perform the stdev calculation in the load script.

I have attached a small qvw file with my workings.  it loads the following test data:

dataset1:

Load * inline [

DYear,CodeName,Value

2009,A,100

2010,A,200

2011,A,300

2012,A,200

2009,B,1100

2010,B,1200

2011,B,1300

2012,B,1200

2009,C,2100

2010,C,2200

2011,C,2300

2012,C,2200

];

dataset2:

load

  CodeName,

  Count(CodeName) as CountOfCodeName,

  stdev(Value) as stdev3

resident tab1

group by CodeName;

The output is displayed here.  as you can see the standard deviation is the same for all CodeNames, where it should be very different due to the different sets of values.

DYearCodeNameABC
2009 81.6496580981.6496580981.64965809
2010 81.6496580981.6496580981.64965809
2011 81.6496580981.6496580981.64965809
2012 81.6496580981.6496580981.64965809

Any assistance or suggestions are gratefully received.

Regards,

John.

1 Solution

Accepted Solutions
SergeyMak
Partner Ambassador
Partner Ambassador

So

The app absolutely correct, because the standard deviation in these set is exactly same

just for example the difference between 100 and 200 is same as 1100 and 1200

I changed values and got different values

PFA

Regards,
Sergey

View solution in original post

2 Replies
SergeyMak
Partner Ambassador
Partner Ambassador

So

The app absolutely correct, because the standard deviation in these set is exactly same

just for example the difference between 100 and 200 is same as 1100 and 1200

I changed values and got different values

PFA

Regards,
Sergey
Anonymous
Not applicable
Author

Oh, that was silly of me!