Site icon i2tutorials

Amazon QuickSight – periodToDateMax

Amazon QuickSight – periodToDateMax

 

Amazon QuickSight is a cloud-based business intelligence and data visualization tool developed by Amazon Web Services. The periodToDateMax function is used to calculate the maximum value of a measure or metric for a given period up to a specified date/time.

 

Syntax

#Start#
periodToDateMax(measure, dateTime, period, endDate)
#End#

 

This function takes the following arguments:

 

 

 

Here’s an example that illustrates how to use the periodToDateMax function in QuickSight:

 

Suppose you have a dataset that contains sales data for a retail store, and you want to calculate the maximum sales amount for each month up to the current date. You can use the following expression:

Example

#Start#
periodToDateMax(Sales, OrderDate, "month")
#End#

 

In this expression, Sales is the name of the measure that you want to calculate the period-to-date maximum for, OrderDate is the date/time field in the dataset that contains the order date for each sale, and “month” is the period that you want to calculate the maximum for.

 

If you want to calculate the period-to-date maximum up to a specific end date, you can include the endDate parameter in the function. For example, to calculate the maximum sales amount for each week up to the end of the current quarter, you can use the following expression:

Example

#Start#
periodToDateMax(Sales, OrderDate, "week", "2023-03-31")
#End#

 

In this expression, “2023-03-31” is the end date of the current quarter.

 

Exit mobile version