Time Series Label Options
A time-series block generates new calculations, based on existing ones, filtered using various ranges of time. The generated calcs have names like "Units M01" and "Units M-1 LY". Time series column labels are put together from all the different parts of the time series. The summary, range, and variation all have parts in the label, and each of those can be controlled.
By default, the label of each calc is the same as its name, which is used as the basis for constructing the name of the new time series column. In order to convey more meaning with the column label, you can use the label-format tag to cause the time-series columns to be generated with more user friendly labels like "Units 2017-Nov".
To use this feature, add label-format= to any year-based or month-based range. In the format string, you can use any date formatting string, for example, "YYYY MMM". You can also use # and ## to include the range index, that is, the 1 in "M-1".
For example, assume the anchor is 2015/11/5 and the date column is a fiscal calendar where the year starts in October: For simplicity, the summary column is "SUMMARY". Part of the times series block might be:
recent-years 2 label-format="YYYY"
This results in a calc named "SUMMARY Y-0", with the label "SUMMARY 2016"; plus a calc named "SUMMARY Y-1", with the label "SUMMARY 2015".
If the times series block includes:
year-to-date label-format="YYYY \\Y\\T\\D"
the result is a calc named "SUMMARY YTD", with the label "SUMMARY 2016 YTD".
If the time series block includes:
all-months label-format="YYYY \\M## (MMM)"
the result is twelve calcs named "SUMMARY M01" through "SUMMARY M12", with labels "SUMMARY 2016 M01 (Oct)" through "SUMMARY 2016 M12 (Sep)".
NOTE: There is an important interaction with variations when using label formatting. Variations adjust the range and affect the name and label of the generated calcs. For instance, "previous-year" pushes the range back by one year, and adds "LY" to the name and label. When label-format is in use, the variation no longer adds that information (for example "LY") to the label. The idea is that the formatted label contains that information already.
When you use previous-year with label-format, instead of getting "2016 LY", you get "2015". For example, if the time series block includes:
month-to-date label-format="YYYY \\M## (MMM) \\M\\T\\D"
the result is a calc named "SUMMARY MTD", with the label "SUMMARY 2016 M02 (Nov) MTD". If the block also includes:
previous-month
the result is a calc named "SUMMARY MTD LM", with the label "SUMMARY 2016 M01 (Oct) MTD"
NOTE: The label-format translation function works only for year and month components to the format. You can use other components in the label-format (for example, "Q" for the quarter number), but time-seires adds "LQ" for the previous-quarter variation rather than translating it for you. You cannot refer to weeks in a time-series label.
There is also a label= option on the summary tag in time-series. This would normally be used to abbreviate or otherwise change the summary name. But you can also use it to remove the summary part of the label, by setting it to an empty string. For example:
summary "Total Admissions Count" label=""
or
summary "Total Admissions Count" label="Admissions <br>"
to cause the label to use two lines.
The label-order option can be used to simply reorder how the label parts are assembled. For example:
label-order "RANGE SUMMARY "
The other parts are VARIATION and SERIES.