This calculates the sum of all values for a series between two dates, or a moving sum of values over a time period. The SUM# function has three formats.
SUM#(Expression,Start Date,End Date)
This static format calculates the sum of all values for a series between two given dates. Actual dates are typed in using either the standard DD/MM/YY format or the displacement date formats.
As a date parameter one can also use YRE, HFE, QTE, MTE, WKE, LYE, BDATE, BDATEXXF
SUM#(Expression)
If you do not specify start and end dates, the defaults are the start and end dates for the display period.
SUM#(Expression,Period)
This moving format calculates a continuous sum of values over the time period specified between the start and end dates for the display period. Use the period codes to specify the period.
SUM#(Expression,Period,N)
This trailing parameter N means that output is null (NA) if there is any null value as input to the sum.
SUM#(USRETTOTD,31/01/98,30/06/98)
This static format gives the total volume of US retail sales (in US$ millions) for the first six months of 1998.
SUM#(USRETTOTD)
This static format calculates the the total volume of US retail sales (in US$ millions) for the display period.
SUM#(D:BMW(VO),1W)
This moving format calculates a continuous total trading volume for BMW (000's of shares traded) over a one week period between the start and end dates for the display period.
You can also use the sum function code as an argument in the ACHV#, PCHV#, and REB# functions. For example:
100+PCHV#(USRETTOTD,SUM)
This expression calculates the monthly percentage share of US retail sales for the total display period. (In this example, you might specify a display period of one calendar year to obtain comparative monthly sales figures for the year.)
You must use a sum period that is consistent with the frequency of the stored data. That is, the Period frequency you request for the function can be greater but not less than the data frequency. For example:
SUM#(UKBCJD..,30D)
A daily time period is invalid for the UK unemployment series because the frequency of the data is monthly.
Note You can use SUM# with a maximum of 4,000 values. If you request a sum period that requires more than 4,000 values, an error message is displayed. To reduce the number of values, either reduce the display period or the sum period. These time periods should not exceed 15 years.