Dynamic attribute member
hi,
i have requirement set attribute members dynamically @ run time.
i describing requirement below -
i have date dimension, specifies business date.
i have instrument dimension, has attribute called maturity date.
now, requirement bucket maturity date based on business date.
for example,
if business date < maturity date bucket = "expired"
if buisness date = maturity date bucket = "active"
if datediff(maturitydate,businesdate) = 1w bucket = "1w" , on...
i tried following -
added dummy attribute instrument dimension called tenorbucket. in dsv, return space.
then, using scope statement, tried determine value follows -
scope([date].[date]);
scope([instrument].[maturity date]);
scope([instrument].[tenor bucket]);
this =
iif(datediff("d",[instrument].[maturity date].currentmember, [date].[date].currentmember) < 0 , "expired",
iif(datediff("d",[instrument].[maturity date].currentmember, [date].[date].currentmember) = 0 , "nostro",
iif(datediff("d",[instrument].[maturity date].currentmember, [date].[date].currentmember) = 1 , "on",
iif(datediff("wk",[instrument].[maturity date].currentmember, [date].[date].currentmember) = 1 , "1w",
iif(datediff("wk",[instrument].[maturity date].currentmember, [date].[date].currentmember) = 2 , "2w",
iif(datediff("m",[instrument].[maturity date].currentmember, [date].[date].currentmember) = 1 , "1m",
iif(datediff("m",[instrument].[maturity date].currentmember, [date].[date].currentmember) = 3 , "3m",
iif(datediff("m",[instrument].[maturity date].currentmember, [date].[date].currentmember) = 6 , "6m",
iif(datediff("m",[instrument].[maturity date].currentmember, [date].[date].currentmember) = 9 , "9m",
iif(datediff("m",[instrument].[maturity date].currentmember, [date].[date].currentmember) = 12 , "12m",
iif(datediff("yy",[instrument].[maturity date].currentmember, [date].[date].currentmember) = 2 , "2y",
iif(datediff("yy",[instrument].[maturity date].currentmember, [date].[date].currentmember) = 3 , "3y",
iif(datediff("yy",[instrument].[maturity date].currentmember, [date].[date].currentmember) = 5 , "5y",
iif(datediff("yy",[instrument].[maturity date].currentmember, [date].[date].currentmember) = 10 , "10y",
iif(datediff("yy",[instrument].[maturity date].currentmember, [date].[date].currentmember) = 15 , "15y",
iif(datediff("yy",[instrument].[maturity date].currentmember, [date].[date].currentmember) = 20 , "20y",
iif(datediff("yy",[instrument].[maturity date].currentmember, [date].[date].currentmember) = 25 , "25y",
iif(datediff("yy",[instrument].[maturity date].currentmember, [date].[date].currentmember) = 30 , "30y",
iif(datediff("yy",[instrument].[maturity date].currentmember, [date].[date].currentmember) > 30 , ">30y","not defined")))))))))))))))))));
but doesnt seem work. missing here?
could please advice if best solution? if not, other options available.
thanks.
regards,
girish
hi girish,
do want implement buckets dynamically mdx? please see article below:
http://blogs.solidq.com/rpertusa/post.aspx?id=5&title=assign+bucket+types+dynamically+with+mdx+and+dynamic+sets+in+analysis+services
serena
SQL Server > SQL Server Analysis Services
Comments
Post a Comment