Important: We've redesigned the Amazon QuickSight analysis workspace. You might encounter screenshots or procedural text that doesn't reflect the new look in the QuickSight console. We're in the process of updating screenshots and procedural text.
To find a feature or item, use the Quick search bar.
For more information on QuickSight's new look, see Introducing new analysis experience on Amazon QuickSight
periodToDateAvgOverTime
The periodToDateAvgOverTime
function calculates the average of a measure for
a given time granularity (for instance, a quarter) up to a point in time.
Syntax
periodToDateAvgOverTime( measure, dateTime, period)
Arguments
- measure
-
An aggregated measure that you want to do the calculation
- dateTime
-
The date dimension over which you're computing PeriodOverTime calculations.
- period
-
(Optional) The time period across which you're computing the computation. Granularity of
YEAR
meansYearToDate
computation,Quarter
meansQuarterToDate
, and so on. Valid granularities includeYEAR
,QUARTER
,MONTH
,WEEK
,DAY
,HOUR
,MINUTE
, andSECONDS
.The default value is the visual's date dimension granularity.
Example
The following function calculates the average fare amount month over mont.
periodToDateAvgOverTime(sum({fare_amount}), pickupDatetime, MONTH)