Children Function in MDX

203
7664

Friends,

This acts similar to AllMembers function when you use this with attributes. PFB sample query of using Children function with attribute.

select [Measures].[Sales Amount] on 0,
[Dim Product].[Products].children on 1
from [Adventure Works]

or

select [Measures].[Sales Amount] on 0,
[Dim Product].[Products].AllMembers on 1
from [Adventure Works]

Both the above queries gives the same output. The power of CHILDREN function will come into picture when you are using this function with Hierarchies. Children function returns the next level members of a specified member or simply to say it returns Children of a member. 

Syntax:

“Member_Expression.Children”

If you have a hierarchy defined then this Children function returns the naturally ordered set which is the children of the member specified. If the specified member has no children, this function returns an empty set.

To demonstrate Children function I created a Dimension named “Dim Time” and defined a Hierarchy with the following levels.

  • Calendar Year
  • Calendar Quarter
  • English Month Name

Now, in the below query I passed 2002 from “Calendar year” level as member_expression to the children function and the query returned the children of 2002 member i.e Quarters 1,2,3,and 4 as shown in below Screenshot.

select [Measures].[Sales Amount] on 0,
[Dim Time].[Hierarchy].[Calendar Year].&[2002].Children on 1
from [Adventure Works]

Now in the below Example I am passing Member from “English Month Name” level of the hierarchy and as this is the last level of the hierarchy, there won’t be any children and hence it returns empty result set as shown in the below screenshot.

select [Measures].[Sales Amount] on 0,
[Dim Time].[Hierarchy].[Calendar Year].&[2002].&[4].&[December].Children on 1
from [Adventure Works]

Note: It is not that the Result set will be empty when you take a member from LAST level of the hierarchy. When you pass ANY MEMBER from ANY LEVEL which doesn’t have children then the result set will be empty. This looks very simple one but it is very useful and powerful when working on MDX Calculations.

That’s it .. Happy Coding !!

Regards,

Roopesh Babu V

 

203 COMMENTS

  1. slots online free
    [url=”https://2-free-slots.com”]online slots that pay real money[/url]
    heart of vegas real casino slots free on facebook

  2. [url=https://drugsonline.store/#]best erectile dysfunction pills[/url] mexican pharmacy without prescription

  3. writing my dissertation
    [url=”https://accountingdissertationhelp.com”]dissertation acknowledgement sample[/url]
    books thesis dissertation help

  4. [url=https://stromectoltrust.com/#]stromectol 3 mg tablets price[/url] stromectol 12 mg tablets

  5. will olumiant work on me [url=https://baricitinib.online/#]olumiant price usa [/url] eli lilly and incyte drug baricitinib case analysis baricitinib 4 mg in india

  6. premium dissertation writing service
    [url=”https://customdissertationwritinghelp.com”]dissertation help uk[/url]
    uf thesis and dissertation

  7. [url=https://canadiandrugs.best/#]buy prescription drugs online legally[/url] meds online without doctor prescription

  8. [url=http://stromectolbestprice.com/#]ivermectin tablets for humans[/url] ivermectin for guinea pig lice

  9. [url=https://drugsbestprice.com/#]pain meds online without doctor prescription[/url] medications list

  10. [url=https://medrxfast.com/#]tadalafil without a doctor’s prescription[/url] buy anti biotics without prescription

  11. casino no deposit bonus win real money usa
    [url=”https://internet-casinos-online.net”]biggest online casino bonus[/url]
    mobile casino games for real money

  12. [url=https://medrxfast.com/#]ed meds online without prescription or membership[/url] buy cheap prescription drugs online

  13. And because Sertraline is a pill taken ahead of time, whether on a daily or an as-needed basis, you won t have to halt the action to apply a topical product buy cialis online usa , nurses, registered dietitians, lifestyle coaches, psychologists and support staff to deliver the most advanced programs

  14. A 2014 study of citations of open access undergraduate theses across 49 repositories found that 4 of undergraduate theses were cited a total of 1,390 times best generic cialis Lilly ICOS, maker of Cialis tadalafil , has initiated the The CialisPromise

  15. The only difference here is the fact that Soft Tabs are chewable, and are available in a wide variety of flavors such as Banana, Strawberry, Lemon or Mint , so the process of Cialis Soft Tabs administration is a bit more pleasant than the process of administration of classical Cialis pills cialis 20mg for sale Instead, what you just read is a mish mash of the messages I ve received over the last 7 years from readers who ve hated their genitals for one reason or another

  16. land slot auto เล่นเกมสล็อตได้ทุกค่าย ครบทุกเกมไปกับ ทุกค่ายเกมสุดสนุก แบบแปลกใหม่ ไม่มีซ้ำใครกันแน่ เล่นได้ไม่น่าเบื่อ PG ไม่เหมือนกันด้วยการเป็นบริการเกมสล็อตออนไลน์

LEAVE A REPLY

Please enter your comment!
Please enter your name here

64 − 54 =