Amazon QuickSight – varp
The Amazon QuickSight VARP function calculates the variance of a population, for a given measure, optionally grouped by a specified level. The VARP function is commonly used in statistics to measure how far a set of values is spread out from the mean.
Syntax
#Start# varp(measure, [group-by level]) #End#
This function takes the following arguments:
- measure: This is a required parameter that specifies the measure for which you want to calculate the variance. It can be a field, an expression, or a calculated field.
- group-by level: This is an optional parameter that specifies the level by which you want to group the data. It can be a field or an expression that represents a category or a dimension in the data.
Suppose you have a dataset that contains sales data for a company, including the sales amount and the region where each sale was made. You want to calculate the variance of the sales amount for each region. To do this, you can use the following VARP function:
Example
#Start# VARP(sales_amount, [region]) #End#
In this example, “sales_amount” is the measure for which you want to calculate the variance, and “region” is the field that represents the level by which you want to group the data. The function will return the variance of the sales amount for each region in the dataset.
Note that the VARP function calculates the variance of a population, rather than a sample. If you want to calculate the variance of a sample, you can use the VAR function instead.