Description
Cumulates a Metric defined on a Time Dimension (Day, Month or Quarter) and resets the cumulation each year.
Equivalent of: CUMULATE(Metric, Quarter, Quarter.Year) or CUMULATE(Metric, Month, Month.Year) or CUMULATE(Metric, Day, Day.Year)
Syntax
YEARTODATE(Metric M, Aggregation])
Arguments
Argument | Type | Dimensions | Description |
---|---|---|---|
Metric (required) | Number | Time Dimension more granular than Year | Number to cumulate. |
Aggregation (optional) | Aggregation | Available values: SUM, AVG, MIN, MAX. By default, the aggregation is SUM. |
Returns
Type | Dimensions |
---|---|
Number | Same Dimensions as argument Metric |
Examples
Formula | Description |
---|---|
| Cumulates the Metric ‘Quantity Sold’ (each day/month/quarter is added to the sum of the previous day/month/quarter and reset when the year changes). |
Calculated Item, Show Value As or Formula?
Pigment also has Calculated Item and Show Value as presets for Year to Date calculations.
Check out this article to see how you can use Show value as to calculate year to date for the entire Metric or use the calculated item preset for getting a Year to Date calculation for an individual item or up until a particular time period. Its important to note, that while theses calculations are easier and more flexible, they can not be referenced by other Metrics.
See also
Related articles: CUMULATE, QUARTERTODATE, MONTHTODATE
More of a hands-on learner?
Talk to your Customer Success Manager about downloading the Functions and Modifiers in Pigment Application into your workspace. It includes examples of every formula and modifier in Pigment!
