Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I need to use the StDev function to display a value across multiple rows of data using two dimensions. However, the value I need only shows up in the total.
I've tried the following, including using nodistinct in the aggr function:
stdev(aggr(count([X]),[Month_Year]))
stdev(aggr(count([X]),[Month_Year], [Product Name]))
Product Name | Month_Year | Count of X | St. Dev |
Product1 | 1-2021 | 867 | - |
Product1 | 2-2021 | 842 | - |
Product1 | 3-2021 | 1043 | - |
Product1 | 4-2021 | 946 | - |
Product1 | 5-2021 | 886 | - |
Product1 | 6-2020 | 686 | - |
Product1 | 6-2021 | 189 | - |
Product1 | 7-2020 | 705 | - |
Product1 | 8-2020 | 723 | - |
Product1 | 9-2020 | 807 | - |
Product1 | 10-2020 | 863 | - |
Product1 | 11-2020 | 771 | - |
Product1 | 12-2020 | 804 | - |
Totals | 203 | ||
This is how it should display:
Product Name | Month_Year | Count of X | St. Dev |
Product1 | 1-2021 | 867 | 203 |
Product1 | 2-2021 | 842 | 203 |
Product1 | 3-2021 | 1043 | 203 |
Product1 | 4-2021 | 946 | 203 |
Product1 | 5-2021 | 886 | 203 |
Product1 | 6-2020 | 686 | 203 |
Product1 | 6-2021 | 189 | 203 |
Product1 | 7-2020 | 705 | 203 |
Product1 | 8-2020 | 723 | 203 |
Product1 | 9-2020 | 807 | 203 |
Product1 | 10-2020 | 863 | 203 |
Product1 | 11-2020 | 771 | 203 |
Product1 | 12-2020 | 804 | 203 |
On a side note, the function works in another table without the date and the following syntax.
STDev(aggr(count(distinct [X]), [Month_Year], [Product Name]))
Then do this
StDev(TOTAL <Product, Date> Aggr(Count(DISTINCT [X]), [Month_Year], [Product Name]))
Try this
StDev(TOTAL Aggr(Count(DISTINCT [X]), [Month_Year], [Product Name]))
Thank you Sunny! This is close. Please see attached.
Still not what you want?
No, I need it to show standard deviation by Product and Date regardless of the selection. Currently it shows it by the current selection.
For example.
Product Date Count Std. Dev (required) Std. Dev (now)
1 6/20 2 .7 2.6
1 6/20 3 .7 2.6
2 6/20 5 2.1 2.6
2 6/20 8 2.1 2.6
Thank you!
Then do this
StDev(TOTAL <Product, Date> Aggr(Count(DISTINCT [X]), [Month_Year], [Product Name]))
This works when I remove Date from the Total. Thank you!