Tod.

La funzione MDX Todate() converte le stringhe di data in numeri utilizzabili nei calcoli di Essbase.

Sintassi

Todate ( string_value_expression_1 ,string_value_expression_2 )

Parametri

espressione_valore_stringa_1

Il formato della stringa di data, "mm-dd-yyyy" o "dd-mm-yyyy" (deve essere in lettere minuscole).

espressione_valore_stringa_2

La stringa della data.

Note

Se si specifica una data precedente al 01-01-1970, questa funzione restituisce un errore.

Esempio

Per i prodotti introdotti prima del 06.01.1996, la seguente query MDX calcola un budget rivisto pari al 110% del 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])

La query precedente restituisce l'output seguente:

Tabella 4-131 Griglia di output da MDX Esempio

Asse-1 Axis-1.properties Budget Budget rettificato
Da 200 a 10 anni (Data introduzione = 27-09-1995, tipo: TIME, ) 11.060 11.060
tra 200 e 20 (Data introduzione = 07-26-1996, tipo: TIME, ) 9.680 10.648
200-30 (Data introduzione = 12-10-1996, tipo: TIME, ) 3.880 4.268
200-40 (Data introduzione = 12-10-1996, tipo: TIME, ) 2.660 2.926