- 1 Minute to read
- Print
- DarkLight
- PDF
2dYTD
- 1 Minute to read
- Print
- DarkLight
- PDF
2dYTD
Adds the current row to the cumulative total and resets when the year changes
- Adds the current row to the running total (TD)
- If the year of the date-time field changes (eg from 2019 to 2020), resets the sequence to the running total to be the current row (Y)
- Resets the sequence when dimension 1 changes (2d)
Purpose
Use this function to:
- Calculate YearToDate, where data needs to be grouped by another dimension and sequence needs to reset when the year changes
Calculation
2dYTD= sum(RowX:Row0)
RowX= current row
Row0 = first row in the sequence
Sample Result
Parameters
Parameter | Description |
---|---|
Dimensions | Discrete field(s). All fields must come from the same table. |
Name | Name to be displayed as Column Header in result grid |
Measure | The field to be used in the post-function calculation.
|
Function | COUNT / SUM / AVG / MIN / MAX / STDEV |
Post | 2dYTD |
Value | Optional. Filter to apply when evaluating FUNCTION. Only records in the Filter Recordset will be included in the Function and Post-Function calculations. Must come from same table as DIMENSION/MEASURE or be linked to the Dimension table. |
Axis | 0 / 1. Y-Axis to use when plotting graph. Default = 0 |
Plot | Y / N. Specifies whether measure’s output column should be plotted on graph. Default = Y |
Resolve | Optional. Resolve level for the measure. If blank, Resolve = Dimension Table |
Series Type | Default / Bar / Stacked Bar / Line / Spline / RangeLow / RangeHigh / CSLow / CSHigh / CSOpen / CSClose Determines the graph style for the measure. |
Popup | Default / None / Extended |
Prefix | $ / £ / E / % |
Usage Notes
Requires 2 dimensions, of which one must be a date-time field or be a numeric sequence containing a valid YYYY format
Sort order is important: Ascending / Descending Label / Value
Example
NOTE: Measure 1 is included purely for illustration. It is not necessary to include this measure for the calculation to work.
Example use: Calculating Year To Date, grouped by Product Group
Dimension: [transaction].[product_group], [transaction].[yearmonth]
Measure 1
| Measure 2
|