Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
kavirao
Contributor II
Contributor II

Calculate std dev using set analysis

Hi

I have requirement where i need to calculate stdev for below table for each quarter for listed companies for both selected companies and not selected companies separately.  
Eg (A,B,C,D,E,F)

If I have selected A,B,C  companies Std calculates.  =Stdev(Aggr(Sum(Sales),Company,QUARTER)).  Its working fine. 

 But  I couldnt able write expression for non selected companies D,E,F  for stdev expression failing   =Stdev(Aggr({<Company = e(Company)>} Sum(Sales),Company,QUARTER))

Any suggestion to write set analysis on this would be great help

Company Q1 Q2 Q3 Q4
D 8 4 0 7
E 2 0 5 2
F 0 3 0 0
Total 11 9 10 15
STDev        

 

4 Replies
MarcoWedel

maybe

Stdev({<Company = e()>} Aggr(Sum({<Company = e()>} Sales),Company,QUARTER))

?

kavirao
Contributor II
Contributor II
Author

Its Not working. 

MarcoWedel




A short example using this expression:

MarcoWedel_0-1648843422911.png

 

MarcoWedel_1-1648843433592.png


Can you describe your expected results in this case?

kavirao
Contributor II
Contributor II
Author

Thanks its working, Could you help me to put this into table irrespectively for all quarters i need to calculate like below.

A     2 /3,61

B    10/3,61

C     6/3,61

D     2/4,00

E     4/4,00

F      9/4.00