Membro precedente
Utilizzando l'ordine dei membri in un profilo Essbase, la funzione MDX PrevMember() restituisce il membro precedente lungo la stessa generazione o livello. Se sono abilitate più gerarchie, questa funzione restituisce NULL se il membro di origine si trova in una gerarchia e il membro risultato appartiene a una gerarchia diversa.
Sintassi
member.PrevMember [( layertype ) ]oppure
PrevMember ( member [,layertype ] )Parametri
Esempio 1
La seguente espressione MDX restituisce [May], che è un passo prima di Jun:
[Jun].prevmemberEsempio 2
La seguente query MDX:
/*
For January, PrevMember doesn't exist
For December, NextMember doesn't exist
*/
WITH
MEMBER
[Measures].[Delta from Previous Month]
AS
' [Measures].[Sales] -
([Measures].[Sales],[Year].CurrentMember.PrevMember)
'
MEMBER [Measures].[Delta from Next Month]
AS
' [Measures].[Sales] -
([Measures].[Sales], [Year].CurrentMember.NextMember)
'
SELECT
{ [Measures].[Sales],
[Measures].[Delta from Previous Month],
[Measures].[Delta from Next Month]
}
ON COLUMNS,
[Year].Levels(0).Members
ON ROWS
FROM Sample.Basic
WHERE
(
[Scenario].[Actual],
[Market].[East],
[Product].[100]
)Restituisce l'output seguente:
Tabella 4-122 Griglia di output da MDX Esempio
| (axis) | Vendite | Delta da mese precedente | Delta da mese successivo |
|---|---|---|---|
| Gen | 2.105 | 2.105 | 44 |
| Feb | 2.061 | -44 | -65 |
| Mar | 2.126 | 65 | -132 |
| Apr. | 2.258 | 132 | -89 |
| Maggio | 2.347 | 89 | -278 |
| giu | 2.625 | 278 | -110 |
| lug | 2.735 | 110 | 62 |
| Ago | 2.673 | -62 | 311 |
| Set | 2.362 | -311 | 268 |
| Ott | 2.094 | -268 | 28 |
| Nov. | 2.066 | -28 | -222 |
| Decimale | 2.288 | 222 | 2.288 |