SQLServerCentral.com / Analysis Services / Data Warehousing / Calculated measure based on dimension attribute repeats / Latest PostsInstantForum.NET v2.9.0SQLServerCentral.comhttp://www.sqlservercentral.com/Forums/notifications@sqlservercentral.comTue, 03 Mar 2015 14:09:00 GMT20RE: Calculated measure based on dimension attribute repeatshttp://www.sqlservercentral.com/Forums/Topic1414412-17-1.aspx[quote][b]Mackers (2/8/2013)[/b][hr]Hi,That's fine if you are writing all the MDX yourself but not ideal if you are using an ad-hoc query tool (like pivot tables in Excel or ProClarity or XLCubed etc)You might find it easier to push the data down to the lowest level of your hierarchyFor example my company budgets at sales team but the lowest level is salesperson. I then push the budget down to and aribitary salesperson in that team and apply the budget to them (or you could split the budget evenly). I appreciate that this is not a true representation of the data but it allows correct rollups & ad-hoc query tools will work correctlyMack[/quote]:blink:The calculated measure is now aggregating at the lowest level of the hierarchy so I am not sure what you mean. Also, it works just fine in Excel. :blink:Fri, 08 Feb 2013 09:33:32 GMTmsmithsonRE: Calculated measure based on dimension attribute repeatshttp://www.sqlservercentral.com/Forums/Topic1414412-17-1.aspxHi,That's fine if you are writing all the MDX yourself but not ideal if you are using an ad-hoc query tool (like pivot tables in Excel or ProClarity or XLCubed etc)You might find it easier to push the data down to the lowest level of your hierarchyFor example my company budgets at sales team but the lowest level is salesperson. I then push the budget down to and aribitary salesperson in that team and apply the budget to them (or you could split the budget evenly). I appreciate that this is not a true representation of the data but it allows correct rollups & ad-hoc query tools will work correctlyMackFri, 08 Feb 2013 05:30:22 GMTMackersRE: Calculated measure based on dimension attribute repeatshttp://www.sqlservercentral.com/Forums/Topic1414412-17-1.aspx[quote][b]msmithson (1/31/2013)[/b][hr]I'm new to SSAS so bear with me.I have a calculated measure based on an attribute in one of my dimensions. The calculation looks like this:CREATE MEMBER CURRENTCUBE.[Measures].[Office Visits] AS sum(EXISTING({[Location].[Place of Service].&[11]}), [Measures].[Encounters]), FORMAT_STRING = "Standard", NON_EMPTY_BEHAVIOR = { [Encounters] }, VISIBLE = 1 , ASSOCIATED_MEASURE_GROUP = 'Encounters' It calculates correctly when I browse by Place of Service but when I try to browse by another attribute of that Location dimension "LocationName" then the calculated measure value just repeats for each LocationName. I'm sure this must have something to do with attribute relationships or the hierarchy but I just don't understand the behavior here. :blink:[/quote]Well after re-reading a chapter on MDX scripting and cube navigation I learned enough to figure out what was happening. This calculation was aggregating at the [Place of Service] level of the hierarchy but not the children. Changed it to this and it worked:CREATE MEMBER CURRENTCUBE.[Measures].[Office Visits] AS sum(EXISTING({([Location].[Place].[Place Of Service].&[11].Children)}, [Measures].[Encounters])), FORMAT_STRING = "Standard", NON_EMPTY_BEHAVIOR = { [Encounters] }, VISIBLE = 1 , ASSOCIATED_MEASURE_GROUP = 'Encounters' ; :w00t:Thu, 07 Feb 2013 10:03:55 GMTmsmithsonCalculated measure based on dimension attribute repeatshttp://www.sqlservercentral.com/Forums/Topic1414412-17-1.aspxI'm new to SSAS so bear with me.I have a calculated measure based on an attribute in one of my dimensions. The calculation looks like this:CREATE MEMBER CURRENTCUBE.[Measures].[Office Visits] AS sum(EXISTING({[Location].[Place of Service].&[11]}), [Measures].[Encounters]), FORMAT_STRING = "Standard", NON_EMPTY_BEHAVIOR = { [Encounters] }, VISIBLE = 1 , ASSOCIATED_MEASURE_GROUP = 'Encounters' It calculates correctly when I browse by Place of Service but when I try to browse by another attribute of that Location dimension "LocationName" then the calculated measure value just repeats for each LocationName. I'm sure this must have something to do with attribute relationships or the hierarchy but I just don't understand the behavior here. :blink:Thu, 31 Jan 2013 18:06:38 GMTmsmithson