MDX Essbase - Script - demo.Basic - list all the parents with at least one zerolevel child.
In the Demo.Basic sample database, we have this hierarchy :
> Accounts
>> Profit
>>> Margin
>>>> Sales
>>>> Cost_of_Goods_Sold
>>> Total_Expenses
>>>> Marketing
>>>> Payroll
>>>> Miscellaneous
>> Profit_%
>> Margin_%
'Margin' and 'Total_Expenses' have got only zerolevel children and if in MDX I script :
«
Filter(Descendants([Accounts]),IsLevel([Accounts].CurrentMember, 1))
»
I can list both items and only them.
However I would like to list all the parents with at least one zerolevel child and obtain a three-item list: 'Accounts', 'Margin' and 'Total_Expenses'. That for, the previous script is not efficient enough because 'Accounts' is not a pure onelevel occurrence.
Could you help me to write a good filter command ?