Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / General / Data Warehousing / March 2006

Tip: Looking for answers? Try searching our database.

Syntax help.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ChrisR - 23 Feb 2006 23:42 GMT
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 - 01 Mar 2006 10:55 GMT
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.

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

Signature

Regards
Darren Gosbell [MCSD]
Blog: http://www.geekswithblogs.net/darrengosbell

> Im a total newbie to Analysis Services and MDX, so please bear with me.
>
[quoted text clipped - 11 lines]
>
> TIA, ChrisR
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.