CURRENTMEMBER function expects a hierarchy expression


i'm having trouble creating calculated member based on attribute in 1 of dimensions.

i have fact table counts products (these financial products, have balances associated them).  stored based on date loaded [batch date].  each product has [added date] associated it; put date in product dimension.  since batch system (more of snapshot transactional), batch date isn't part of true date dimension.

what i'm trying list count of products date , count of products added on each batch date.  i"m trying create calculated member give me count of products added on date, i'm pretty sure don't know i"m doing!:)  since intersection of [added date] , [batch date] gives me many added dates, i'm using hte lastchild give me items added on [batch date]. below query, keep getting error "the currentmember function expects hierarchy expression fo 1 argument.  member expression used.  know it's simple mdx issue, use help.

  with member [measures].[products added] as     ([product].[added date].[added date].currentmember.lastchild,    [measures].[product count])  select   {    ([measures].[product count]),    ([measures].[products added])  }   on columns,    {    ([batch date].[batch date])  }   on rows  from [mycube]  

hi trent,

the specific error comes because trying do:

[product].[added date].[added date].currentmember -> [dim].[hier].[level].currentmember, when should doing:
[product].[added date].currentmember -> [dim].[hier].currentmember

however, give 1 member, not a set , lastchild function not give same member.

the way believe want work match batch dates , added dates? batch date = added date?

if so, can write:

with member [measures].[products added] as
(linkmember([product].[batch date].currentmember, [product].[added date]), [measures].[product count])

hope understood requirement correctly.


boyan penev --- http://www.bp-msbi.com


SQL Server  >  SQL Server Analysis Services



Comments

Popular posts from this blog

Conditional formatting a graph vertical axis in SSRS 2012 charts

Register with Power BI failed

SQL server replication error Cannot find the dbo or user defined function........