ClosingPeriod function in MDX

2
19307

Friends,

In this post we are gonna discuss about ClosingPeriod function. This is one of the Time functions we have. This function returns the member that is the last sibling among the descendants of a specified member at a specified level.

The syntax is given below –

CLOSINGPERIOD( [«Level»[, «Member»] ] )

Level – A valid MDX expression level.
Member – A valid MDX expression member. This is not a mandatory parameter.

The different possibilities are given below.

  • If ONLY level expression is provided then the function returns the last member of the level provided.
  • If both level and member is provided then the function returns the last member of the level provided of the supplied Member.
  • If none of the parameters are provided then the function returns the last sibling of the default time member if any.

Let’s see the examples of each ..

SELECT ClosingPeriod() ON 0
FROM [Adventure Works DW]

When we executed the above query then it returns the default time dimension member last sibling as shown below.

When you pass the level to the function as shown below then it returns the last member of the level supplied.

SELECT ClosingPeriod([Due Date].[Calendar Hier].[English Month Name]) ON 0
FROM [Adventure Works DW]

When you pass the level and also member to the function as shown below then it returns the last member of the level supplied for the supplied member.

SELECT ClosingPeriod([Due Date].[Calendar Hier].[English Month Name],
[Due Date].[Calendar Hier].[Calendar Year].&[2003]) ON 0
FROM [Adventure Works DW]

The above query returns last member of the year 2003 which is December as shown below.

This is it .. Hope you understood .. 🙂

Regards,
Roopesh Babu V

2 COMMENTS

  1. Купить бытовку распашонку (двп) 184 900? (в т.ч. НДС)
    Аренда бытовки распашонки (двп)
    9 000? в месяц (в т.ч. НДС)
    Внешний размер контейнера 5850х2400х2400(в).
    Каркас стальной, верхняя и нижняя рама из промышленных сложногнутых профилей различной конфигурации, ширина верхнего пояса 160 мм, нижнего 120 мм, стойки стальные гнутые шестигранные 150х100 мм.
    Кровля – лист стальной оцинкованный 0,5 мм, соединенный двойным стоячим фальцем по всей дине контейнера.
    Стены каркасные из бруса 40х100, снаружи профилированный оцинкованный лист С-8.
    Два окна ПВХ 900х1100(в) с поворотно-откидной створкой.

  2. Kantorbola adalah situs gaming online terbaik di indonesia , kunjungi situs RTP kantor bola untuk mendapatkan informasi akurat rtp diatas 95% . Kunjungi juga link alternatif kami di kantorbola77 dan kantorbola99 .

LEAVE A REPLY

Please enter your comment!
Please enter your name here

4 + three =