Skip to main content

Hello,

 

I have a set of monthly data that I'd like to aggregate and calculate z-scores on, which I'd use in a table to show the z-scores for the last month. I can get calculate the z-score on a trendline easily, but I'd like to sort or filter on the last month's z-score only, hence the need for a calculated field. The data is set up in a way that there are multiple rows per month, i.e.:

 

MonthCategoryCount10/1/2013A100010/1/2013B150011/1/2013A110011/1/2013B145012/1/2013A120012/1/2013B1600

 

So far, I've got the easy pieces done:

 

Last Month: sum(if month="x" then [count] end)

Average: sum([Count])/CountD([Month])

 

I'm running into trouble with the standard deviation, though. If I use the STDEV function in a calculated field, I get STDEV(1000,1500,1100,1450,1200,1600)=242, which is of course how it's supposed to work. What I'd like to get instead is the monthly aggregation, that is STDEV((1000+1500),(1100+1450),(1200+1600)), or STDEV(2500,2550,2800)=161. I'm sure if I created a calculated field for each month I could get it to work, but I'm wondering if there's a simpler way that I'm perhaps missing.

5 answers
  1. Dec 27, 2013, 6:29 AM

    Hello Mark,

     

    To solve your scenario and requirements we have to use Table Calculation for calculating Mean, Standard Deviation and Z-score based on aggregated data per month.

     

    Table calculations (Mean, Stdev and Z-score) should be compute using Table down in the configuration of the worksheet Sheet 2.

     

    See attached a workbook using your sample data, specifically Sheet 2

     

    Note: Attached workbook is in version 8.0

     

    I hope this helps,

     

    Best regards,

    Ramon

0/9000