Preserving change dates

All expressions can operate on Timelines in a way in which the change dates for the input timeline values map naturally through to the change dates for the resultant timeline value.

The examples above have introduced the concept of operating on timelines (is married timeline, has a dependent under 16 years of age timeline) to produce an output timeline (is lone parent of a minor timeline).

More formally, for any CER expression that operates on one or more values, CER allows that expression to operate on a timeline of those values too. In general, any operation that can be applied to primitive types (e.g. Date, Number, String, Boolean, etc.) in order to come up with a result, can instead be applied to Timelines of those types (e.g. Timeline<Date>, Timeline<Number>, Timeline<String>, Timeline<Boolean>) to come up with a result which is a Timeline value.

CER contains special expressions named timelineoperation and intervalvalue which shield the other CER expressions from "knowing" that they are operating on Timelines.

For example, CER contains a sum expression to add a list of numbers. If a person has several incomes, then we can sum those incomes at a point in time in order to derive the person's total income at that point in time. However, if instead we have timelines of how those income amounts change over time, then we can just as easily use the sum expression to derive how the total income changes over time:

Figure 1. A Total Income Timeline, Calculated using sumA Total Income Timeline example.