This calculates the median value for the series (the middle value in an ordered set of the values in the date range).A parameter N can be used to return N/A if there are any missing values in the data sample.
MED#(Expression,Start date,End date)
Actual dates are typed using either the standard format DD/MM/YY or the displacement date format, for example -NY.
As a date parameter one can also use YRE, HFE, QTE, MTE, WKE, LYE, BDATE, BDATEXXF
MED#(Expression, Period)
This can be used on a rolling basis, with a period such as 2M.
MED#(Expression, Period,Parameter)
The parameter set to N means that if there are any missing values in the data sample the output will be N/A.
MED#(Expression)
If you do not specify start and end dates, the defaults are the start and end dates for the display period.
MED#(MKS,31/12/95,31/12/98)
This calculates the median in the Marks and Spencer share price over the three year period, 31/12/95 to 31/12/98.
MED#(MKS)
This default format calculates the median in the Marks and Spencer share price between the start and end dates for the display period.
MED#(MKS,-1Q,)
This calculates the median in the Marks and Spencer share price for the previous quarter. When no end date is specified, the end date for the display period is used.
MED#(MKS,6M)
This calculates the median in the Marks and Spencer share price for the previous 6 months, on a rolling basis.
MED#(PCH#(MKS,1M),6M)
This calculates the median 1 month percentage change in the Marks and Spencer share price, over a 6 month period.
MED#(PCH#(BBH,1M),48M,N)
This calculates a rolling median for a stock’s monthly returns but only shows valid output provided there are four years of monthly returns available without N/A values.
The rolling time period format of the MED# function is not currently supported by AFO in the Functions selector, Intellisense or Expression Builder, however it can be used directly in requests. It is fully supported in DFO and Datastream Charting, including the web Expression Builder.