Converts date strings to numbers that can be used in calculation formulas. @TODATE converts date strings into the number of seconds elapsed since midnight, January 1, 1970.
@TODATE (formatString, dateString)
formatString | The format of the date string, either "mm-dd-yyyy" or "dd-mm-yyyy" (must be in lower case). |
dateString | The date string. |
The following example is based on the Sample Basic database.
Marketing (IF (@ATTRIBUTEVAL("Intro Date") > @TODATE("mm-dd-yyyy","06-30-1996")) Marketing - (Marketing * .1); ENDIF;);
This formula searches for members with an Intro Date attribute member that is later than 6-30-96 and decreases Marketing for those members by 10 percent. In order to process the formula, Analytic Services converts the date strings to numbers before it calculates.
This example produces the following report:
Actual Jan Massachusetts Marketing Intro Date_12-10-1996 200-30 9 200-40 9 Intro Date_10-01-1996 400-10 9 400-20 9 Intro Date_07-26-1996 200-20 9 Intro Date_06-26-1996 300-10 9 300-20 9 300-30 9 Intro Date_04-01-1996 100-20 10 100-30 10 Intro Date_03-25-1996 100-10 10 Intro Date_09-27-1995 200-10 10
@ATTRIBUTE
@ATTRIBUTEVAL
@WITHATTR
©2004 Hyperion Solutions Corporation. All Rights Reserved. http://www.hyperion.com |