5 Replies Latest reply: Jul 8, 2014 3:03 PM by Nick Listerman

# StDev and Avg of a row in a pivot table with 2 dimensions

I'm attempting to calculate the standard deviation and average of a product (row) over 60 days (columns).  I'd like to be able to identify the standard deviation and the average of each product at the end of each row.

• ###### Re: StDev and Avg of a row in a pivot table with 2 dimensions

You can't have two total columns using the partial sums feature, only one. You can use calculated dimensions, but those will be shown on the left with the other dimensions. See attached qvw.

• ###### Re: StDev and Avg of a row in a pivot table with 2 dimensions

Can I somehow get the calculated dimension value in the expression?  I'd like to color certain cells based on those 2 calculations.

• ###### Re: StDev and Avg of a row in a pivot table with 2 dimensions

Click on the + in front of the expression, select Background color and reuse the expression there to create an expression to determine the background color.

You could put the expression of the calculated dimension in a variable and use that everywhere you want to use that expression. That way you'll have to change it only in one place (in the variable) to change all the expressions that use the variable.

• ###### Re: StDev and Avg of a row in a pivot table with 2 dimensions

I attempted to copy the calculated dimensions to the background style of the volume expression and only a few cell colors changed.  When I add the calculated dimension as an expression to see what the cells are verifying, the StDev and Avg are correct but they do not appear in every cell.  Only the cells that are coloring actually know the StDev and Avg.

Would I variable work for this since the value of the variable is different for every row?

• ###### Re: StDev and Avg of a row in a pivot table with 2 dimensions

anyone have ideas?  need to color cells (using expression background color) based on the rows standard deviation and average.