/    /  Amazon QuickSight – stdevpIf

Amazon QuickSight – stdevpIf

 

The stdevpIf() function in Amazon QuickSight is a statistical function that calculates the population standard deviation of a measure based on certain conditions.

 

Syntax

#Start#
stdevpIf(measure, conditions)
#End#

 

This function takes the following arguments:

 

  • measure: This parameter specifies the measure for which you want to calculate the population standard deviation. The measure can be a field or an expression.
  • conditions: This parameter specifies the conditions that must be met for a data point to be included in the calculation. You can specify multiple conditions using logical operators such as AND, OR, and NOT.

 

Suppose you have a sales dataset with the following fields: Date, Product, Sales, and Region. You want to calculate the population standard deviation of sales for the Region “East”. Here’s an example formula:

 

Example

#Start#
stdevpIf(Sales, Region = "East")
#End#

 

This formula calculates the population standard deviation of the Sales field, but only for the data points where the Region field is equal to “East”. The = operator is used to specify the condition for inclusion in the calculation.

 

You can also use other logical operators and functions in the conditions parameter to specify different criteria for inclusion in the calculation. For example, you could calculate the population standard deviation of sales values that are greater than the average sales value, using the following formula:

 

Example

#Start#
stdevpIf(Sales, Sales > avg(Sales))
#End#

 

This formula calculates the population standard deviation of the Sales field, but only for the data points where the Sales value is greater than the average sales value. The > operator is used to specify the condition for inclusion in the calculation, and the avg() function is used to calculate the average sales value.