Using a Date Attribute in a Calculated Indicator In this calculation, two reading-based inputs from the same indicator are used to calculate the rate of rise of that indicator based on its last 10 readings. The two inputs are: • ReadingDifference is a numeric reading-based input that looks at the last 10 readings for an indicator. The Difference aggregation type has been selected for the input, which calculates the difference between the first reading and the last one. • DateArray is defined as a reading-based input based on the same indicator as above. The attribute used to derive the value of this input is the reading’s Date Collected attribute. It therefore returns a list of 10 dates. The first date in the Array is that of the earliest reading. This calculation takes the difference in reading values and divides it by the number of days that have elapsed between the first and 10th reading. To do this, it first declares a variable called DateDelta. The value of this variable is then set by subtracting the first date in the array from the last one, which results in the number of days. Next, the value of the ReadingDifference input is divided by the value in the DateDelta variable. For example: VB.NET Dim DateDelta As TimeSpan = DateArray(9) - DateArray(0) Return ReadingDifference/Date.Delta.TotalDays C# TimeSpan DateDelta = DateArray[9] - DateArray[0]; return ReadingDifference/DateDelta.TotalDays;