Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

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
MVP
MVP

Re: Stdev using more than one variable?!

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.

8 Replies
Highlighted
Not applicable

Re: Stdev using more than one variable?!

Have you tried RangeStdev?

Not applicable

Re: Stdev using more than one variable?!

Thanks!

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

 

 

RangeStdev

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

Not applicable

Re: Stdev using more than one variable?!

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

Re: Stdev using more than one variable?!

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

Not applicable

Re: Stdev using more than one variable?!

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

MVP
MVP

Re: Stdev using more than one variable?!

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

Re: Stdev using more than one variable?!

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!?

MVP
MVP

Re: Stdev using more than one variable?!

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.