Todate
The MDX Todate() function converts date strings to numbers that can be used in Essbase calculations.
Syntax
Todate ( string_value_expression_1 ,string_value_expression_2 )
Parameters
Notes
If you specify a date that is earlier than 01-01-1970, this function returns an error.
Example
For products introduced before 06.01.1996, the following MDX query calculates a Revised Budget that is 110% of Budget:
WITH MEMBER
[Scenario].[Revised Budget]
AS
'IIF (
[Product].CurrentMember.[Intro Date]
> TODATE("mm-dd-yyyy","06-01-1996"),
Budget * 1.1, Budget
)'
SELECT
{[Scenario].Budget, [Scenario].[Revised Budget]}
ON COLUMNS,
[Product].[200].Children
DIMENSION PROPERTIES [Intro Date]
ON ROWS
FROM Sample.Basic
WHERE ([Measures].[Sales], [Year].[Qtr3])
The above query returns the following output:
Table 4-131 Output Grid from MDX Example
Axis-1 | Axis-1.properties | Budget | Revised Budget |
---|---|---|---|
200-10 | (Intro Date = 09-27-1995, type: TIME, ) | 11060 | 11060 |
200-20 | (Intro Date = 07-26-1996, type: TIME, ) | 9680 | 10648 |
200-30 | (Intro Date = 12-10-1996, type: TIME, ) | 3880 | 4268 |
200-40 | (Intro Date = 12-10-1996, type: TIME, ) | 2660 | 2926 |