Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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
];
Presumably, something about either your set analysis or your data does not match what you describe, because the stdev() value is correct here...
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.
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.
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.
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.
I have found the solution by using rangeStdev function which has solved my issue. Thanks for sharing your valuable expertise.