Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I've got an error with variance in qlikview
This is the series of grades obtained in the by 70 students
COUNTRY | NB_STU | NOTES |
P1 | 1 | 4 |
P1 | 1 | 5 |
P1 | 7 | 6 |
P1 | 3 | 7 |
P1 | 10 | 8 |
P1 | 12 | 9 |
P1 | 8 | 10 |
P1 | 2 | 11 |
P1 | 6 | 12 |
P1 | 6 | 13 |
P1 | 6 | 14 |
P1 | 3 | 15 |
P1 | 2 | 16 |
P1 | 0 | 17 |
P1 | 1 | 18 |
P2 | 1 | 20 |
P2 | 1 | 10 |
I need to calculate variance for each country such as
| VARIANCE |
P1 | 9,370891 |
P2 | 25 |
P1+ P2 | 10,46714 |
I’ve used formula
sum(
(
NB_STU
)
*
sqr(
NOTES -
sum(
total
Aggr(Sum(NOTES * NB_STU), COUNTRY)
/Aggr(Sum(NB_STU), COUNTRY)
)
)
)
/
sum(Aggr(Sum(NB_STU), COUNTRY))
It works only if I filter data on a country
PAYS | VARIANCE |
PAYS1 | 9,37 |
But KO when no filter
PAYS | VARIANCE |
PAYS1 | 234,37 |
PAYS2 | 128,26 |
I can’t identify what is wrong, could someone help please?
Thanks a lot
hello,
use function stdev() for standard deviation it's more simple,
regards
Hi,
Thanks for the function but I can't see how to use it with two kpi
Remove word total in sum (total aggr(
Hi
I apologize you're rigth for your formula, stdev doesn't work
regards