Site icon i2tutorials

Amazon QuickSight – periodToDateVar

Amazon QuickSight – periodToDateVar

 

The periodToDateVar() function in Amazon QuickSight is a statistical function that calculates the sample variance of a measure for a given time period. This function is useful when you want to measure the variability of a measure over a specific time period.

 

Syntax

#Start#
periodToDateVar(
    measure, 
    dateTime, 
    period, 
    endDate (optional)
)
#End#

 

This function takes the following arguments:

 

 

Suppose you have a sales dataset with the following fields: Date, Product, Sales, and Region. You can use the periodToDateVar() function to calculate the sample variance of sales for the current week by region. Here’s an example formula:

 

Example

#Start#
periodToDateVar(Sales, Date, 'week', now(), Region)
#End#

 

This formula calculates the sample variance of the Sales field for the current week, grouped by Region. The now() function is used to specify the current date and time as the end date. This function can help you identify the level of variability of sales for the week in each region. Note that if you want to calculate the population variance, you should use the periodToDateVarP() function instead.

 

Exit mobile version