/    /  Amazon QuickSight – periodToDateMin

Amazon QuickSight – periodToDateMin

 

Amazon QuickSight is a business analytics and intelligence tool offered by Amazon Web Services. One of its functions is ‘periodToDateMin()’, which calculates the minimum value for a given measure for the specified time period.

 

Syntax

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

 

This function takes the following arguments:

 

  • measure: This parameter specifies the measure for which you want to calculate the minimum value. The measure can be a field or an expression.
  • dateTime: This parameter specifies the date and time for which you want to calculate the minimum value. The parameter should be in the timestamp format.
  • period: This parameter specifies the time period for which you want to calculate the minimum value. The valid values for the period parameter are hour, day, week, month, quarter, and year.
  • endDate (optional): This parameter specifies the end date and time of the time period. If this parameter is not specified, the current date and time will be used as the end date.

 

 

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

Example

#Start#
periodToDateMin(Sales, Date, 'day', now(), Region)
#End#

 

This formula calculates the minimum value of the Sales field for the current day, grouped by Region. The now() function is used to specify the current date and time as the end date.