Saturday, February 25, 2012

Default_Member

How can I make a default_member dynamic.

Somethin like this:

ALTERCUBECURRENTCUBE

UPDATEDIMENSION [Time],

DEFAULT_MEMBER=[Time].[By Year].[Year].&[ + datepart("YYYY",now()) + ];

Thanks in advance

Using a Default Member other than the ALL member may introduce confusion in your results. Still, if this is required, I wouldn't try to determine it dynamically for something like a year which will change relatively infrequently.

You can use AMO to change a dimension's default member programattically. Before you process your dimension, calculate the desired default member, compare it to the current default member, and then change it if necessary. I'm not certain if in doing this you invalidate the dimension's data. If so, you would need to reprocess the dimension and any relating measure groups.

Good luck,
Bryan

No comments:

Post a Comment