Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Charlie007
Contributor II
Contributor II

Help required for calculation of Standard Deviation

I need help in calculating Standard Deviation of values (43.10,44.92,34.49,53.22,77.06,45.08,59.07,39.04,63.79,42.13,36.93,33.11) . In excel I got result of these values 13.23 by using formula Stdev(range of these values) while in QlikView I use the formula like NUM(Stdev({<[OPRYEAR]={'$(=vlYear)'}>} RATE),'###.##') but here I got 5.65 where vlYear is a variable having last year value e.g. 2021 and rate contains all the values as mentioned above & OPRYEAR is a field containing years. Please help me to resolve this issue.

Labels (1)
6 Replies
Or
MVP
MVP

Load * INLINE [
Number
43.10
44.92
34.49
53.22
77.06
45.08
59.07
39.04
63.79
42.13
36.93
33.11
];

Or_0-1665557209372.png

Presumably, something about either your set analysis or your data does not match what you describe, because the stdev() value is correct here...

Charlie007
Contributor II
Contributor II
Author

I have mentioned the  formula like NUM(Stdev({<[OPRYEAR]={'$(=vlYear)'}>} RATE),'###.##') but here I got 5.65, which is used in Expression. Please guide me is there anything wrong with this formula.

Or
MVP
MVP

There's nothing inherently wrong with the formula, but I have no way of knowing what actually resides in the vlYear variable, the OPRYEAR field, or your data - one of these is presumably not what you're expecting.

Charlie007
Contributor II
Contributor II
Author

vlYear vairable holds the value of last year. Suppose if I choose year 2022 the vlYear will hold value 2021, so it means that I am calculating Standard Deviation for last year. I hope now the logic is clear to you.

Or
MVP
MVP

Unfortunately, it's not a question of logic. As you can see with the inline load, putting these values into STDEV() will get the correct result, so the issue is that your formula doesn't seem to actually be putting these values into STDEV but rather a different set of values (either a subset of these, or more values that aren't listed, or some combination thereof). This isn't something that can be deduced from the information you've provided, so you'll need to either share a sample app or debug on your end.

Charlie007
Contributor II
Contributor II
Author

I have found the solution by using rangeStdev function which has solved my issue. Thanks for sharing your valuable expertise.