Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Stdev using more than one variable?!

Hi,

If I want to use the Stdev function over more than one variable like this:

 

Stdev

(Total<Factory, [Package System], SizeCodeID, Variable, Year, Month>([web 1], [web 2], [web 3]))

How do I make it to work??

Thanks!

Brgs

Marita

1 Solution

Accepted Solutions
swuehl
MVP
MVP

That's what I was talking about when I said, it's easy to mess around with statistics.

Well, before you try to calculate the stdev of different samples, what about creating one variable / sample from your three?

TotalSample:

LOAD ResultInformationID, [web 1] as TotalSample resident tbl_Result;

LOAD ResultInformationID, [middle web] as TotalSample resident tbl_Result;

LOAD ResultInformationID, [last web] as TotalSample resident tbl_Result;

And then just use

avg(TotalSample)

resp.

stdev(TotalSample)

This is assuming that your three samples can be combined into one.

View solution in original post

8 Replies
Not applicable
Author

Have you tried RangeStdev?

Not applicable
Author

Thanks!

I´m sorry frankcrezee but how do you meen??

 

 

RangeStdev

([web 1],[web 2],[web 3]) dosen´t work......

Not applicable
Author

Are you trying to calculate in the script or in the front end?

rangeStdev(var1,var2,var3) should work.

Could you maybe upload an qvw example file?

Not applicable
Author

In an expression for a chart and when I enter the RangeStdev function i dont get any results!

Not applicable
Author

Now i´ve uploaded the file, it´s the chart at the bottom, Stdev column!

swuehl
MVP
MVP

I believe rangestdev() expects a range of unambiguous values as arguments, no fields.

It's hard to advice you here, because its really easy to mess with statistics

It seems that your sample values are defined by

([web 1]+[middle web]+[last web])/3)

at least that's what you calculate the average from

Avg(Total<Factory, [Package System], SizeCodeID, Variable, Year, Month>([web 1]+[middle web]+[last web])/3)

I believe you don't need to use the total with fields in this case, since you are stating all your dimensions, so maybe

Avg( ([web 1]+[middle web]+[last web])/3)

is enough (it's reproducing the same results in your sample file).

So the standard deviation of your sample values should be

stdev( ([web 1]+[middle web]+[last web])/3 )

Hope this helps,

Stefan

Not applicable
Author

Ok thank you Stefan for you reply. However this is the solution i hade from the beginning when i realized that the numbers i get were wrong. The reason for this is because I add all webs together and then do the Stdev function, this is not correct.

I need to bunch all webs together into one variable and then take Stdev on that variable or I need to take Stdev on several varaibles without adding them together first :-).

Hope this makes seans to someone, because i´m lost!?

swuehl
MVP
MVP

That's what I was talking about when I said, it's easy to mess around with statistics.

Well, before you try to calculate the stdev of different samples, what about creating one variable / sample from your three?

TotalSample:

LOAD ResultInformationID, [web 1] as TotalSample resident tbl_Result;

LOAD ResultInformationID, [middle web] as TotalSample resident tbl_Result;

LOAD ResultInformationID, [last web] as TotalSample resident tbl_Result;

And then just use

avg(TotalSample)

resp.

stdev(TotalSample)

This is assuming that your three samples can be combined into one.