|
Home > Archive > MS SQL Data Warehousing > March 2006 > Syntax help.
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| ChrisR 2006-02-25, 9:28 am |
| Im a total newbie to Analysis Services and MDX, so please bear with me.
This code works:
IIF(Ancestor([Product].CurrentMember,[Product].[Category]).Name =
"Bread","Bring","Don't Bring")
So it would seem to me that this code would be syntactically correct, but
its not:
Ancestor ([Product].CurrentMember,[Product].[Category],1)
Can someone please assist?
TIA, ChrisR
| |
| Darren Gosbell 2006-03-05, 8:24 pm |
| No, it's not syntactically correct. Ancestor() expects 2 parameters, not
3.
From Books On Line:
Level
Ancestor(«Member», «Level»)
Returns the ancestor of «Member» from the dimension level specified in
«Level».
Distance
Ancestor(«Member», «Numeric Expression»)
Returns the ancestor of «Member» that is «Numeric Expression» steps away
in the hierarchy.[color=darkred]
So you either need to tell the ancestor function which level to get the
ancestor from or the number of levels to walk up the hierarchy
--
Regards
Darren Gosbell [MCSD]
Blog: http://www.geekswithblogs.net/darrengosbell
In article <53DD01BB-FC62-4B76-9F2C- E82B4CD4006E@microso
ft.com>,
ChrisR@discussions.microsoft.com says...[color=darkred]
> Im a total newbie to Analysis Services and MDX, so please bear with me.
>
> This code works:
>
> IIF(Ancestor([Product].CurrentMember,[Product].[Category]).Name =
> "Bread","Bring","Don't Bring")
>
> So it would seem to me that this code would be syntactically correct, but
> its not:
>
> Ancestor ([Product].CurrentMember,[Product].[Category],1)
>
> Can someone please assist?
>
> TIA, ChrisR
>
|
|
|
|
|