Site icon i2tutorials

Amazon QuickSight – periodOverPeriodDifference

Amazon QuickSight – periodOverPeriodDifference

 

The periodOverPeriodDifference function in Amazon QuickSight is used to calculate the difference between a measure’s values across different periods. It takes in four parameters: measure, date, period, and offset.

 

Syntax

#Start#
periodOverPeriodDifference(
measure, 
date, 
period, 
offset)
#End#

 

This function takes the following arguments:

 

 

Suppose you have a dataset with a Sales measure and a Date field that contains the date of each sale. You want to calculate the difference in sales between the current month and the previous month. You can use the periodOverPeriodDifference function as follows:

 

Example

#Start#
periodOverPeriodDifference(
    Sales, 
    Date, 
    "month", 
    -1
)
#End#

 

This will return the difference in sales between the current month and the previous month. If the current month has sales of $10,000 and the previous month had sales of $8,000, the function would return $2,000.

 

Exit mobile version