Showing posts with label divided. Show all posts
Showing posts with label divided. Show all posts

Tuesday, March 27, 2012

Calculated Measure will not deploy

I have a calculated measure which simply tries to generate a Margin Percentage. This is very simply one Measure divided by another. The problem is that when I try to deploy this measure with a Parent Hierarchy of measures it will not deploy I get the error

Errors and Warnings from Response
MdxScript(OPWDW) (7, 8) The 'Measures' dimension contains more than one hierarchy, therefore the hierarchy must be explicitly specified.

Strangly I have managed to get it to deploy once but then the build fails with the same error. I am not sure why this happens as I have done nothing different from what I would normally do and the Measures dimension does only have one hierarchy.

Just out of interest my colegue is also having the same problem with a different cube the only difference between this and what we have done in the past is that we are using SP1 of sql 2005 does this change the requirements for our MDX query I am just dragging two measures on and sticking a / between them|||

Found the answer

Change

CURRENTCUBE.[MEASURES]

to

CURRENTCUBE.[Measures]

|||

Hi Sax,

I tried to changed it but it still same error. How you can solve this error.

Rgds.,

|||

When I changed the case this worked for me (maybe try all lowercase)

Also make sure you have SP installed and all 5 hotfixes applied otherwise this seems to cause a problem

Cheers

|||

Hi Sax,

After I had to fix SP and did it again, it work.

Thank for your information.

sql

Calculated Measure will not deploy

I have a calculated measure which simply tries to generate a Margin Percentage. This is very simply one Measure divided by another. The problem is that when I try to deploy this measure with a Parent Hierarchy of measures it will not deploy I get the error

Errors and Warnings from Response
MdxScript(OPWDW) (7, 8) The 'Measures' dimension contains more than one hierarchy, therefore the hierarchy must be explicitly specified.

Strangly I have managed to get it to deploy once but then the build fails with the same error. I am not sure why this happens as I have done nothing different from what I would normally do and the Measures dimension does only have one hierarchy.

Just out of interest my colegue is also having the same problem with a different cube the only difference between this and what we have done in the past is that we are using SP1 of sql 2005 does this change the requirements for our MDX query I am just dragging two measures on and sticking a / between them|||

Found the answer

Change

CURRENTCUBE.[MEASURES]

to

CURRENTCUBE.[Measures]

|||

Hi Sax,

I tried to changed it but it still same error. How you can solve this error.

Rgds.,

|||

When I changed the case this worked for me (maybe try all lowercase)

Also make sure you have SP installed and all 5 hotfixes applied otherwise this seems to cause a problem

Cheers

|||

Hi Sax,

After I had to fix SP and did it again, it work.

Thank for your information.

Calculated Measure will not deploy

I have a calculated measure which simply tries to generate a Margin Percentage. This is very simply one Measure divided by another. The problem is that when I try to deploy this measure with a Parent Hierarchy of measures it will not deploy I get the error

Errors and Warnings from Response
MdxScript(OPWDW) (7, 8) The 'Measures' dimension contains more than one hierarchy, therefore the hierarchy must be explicitly specified.

Strangly I have managed to get it to deploy once but then the build fails with the same error. I am not sure why this happens as I have done nothing different from what I would normally do and the Measures dimension does only have one hierarchy.

Just out of interest my colegue is also having the same problem with a different cube the only difference between this and what we have done in the past is that we are using SP1 of sql 2005 does this change the requirements for our MDX query I am just dragging two measures on and sticking a / between them|||

Found the answer

Change

CURRENTCUBE.[MEASURES]

to

CURRENTCUBE.[Measures]

|||

Hi Sax,

I tried to changed it but it still same error. How you can solve this error.

Rgds.,

|||

When I changed the case this worked for me (maybe try all lowercase)

Also make sure you have SP installed and all 5 hotfixes applied otherwise this seems to cause a problem

Cheers

|||

Hi Sax,

After I had to fix SP and did it again, it work.

Thank for your information.

Sunday, March 25, 2012

Calculated Measure Error

In the calculated measure formula when something is being divided by 0.XX (like 0.35..fractions) its producing those wrong figures where decimal is at a wrong place. But if we divide the numerator and denominator by 100, we get the correct figures.

[something].[Something] *100 / 0.XX *100 = good

[something].[Something] / 0.XX = wrong

Why is that? and what can be done to do it right. Thanks.

Are you using AS 2000 or AS 2005, and can you reproduce this problem with one of the standard cubes (like Foodmart or Adventure Works)?

Monday, March 19, 2012

Calcualted Cells Performance Problem

Hello,

Initially the business divided its Practices into two groups, Industrial and Functional which were maintained in the relational source system as two seperate tables. The business has decided to expand the number of practices it reports on, however changes to the relational source system has not fully been implemented. We require reporting on the Budget data now so we've created a dimension named "Practices" which follows the same dimensional structure as the "Inudstry" and "Function" dimensions except that there is an extra parent level of "Practice Type". I would like to hide this new all inclusive "Practices" dimension from end users and effectively look up the corresponding value in the Industry or Function dimension from the Budget fact table.

I have the following calculated cell which achieves the desired results but has rather slow perforamce.

CREATE CELL CALCULATION CURRENTCUBE.[Budget Functional Practice]

FOR

'({[Measures].[Budget]},

[Fiscal Date].[Fiscal].[Fiscal Mo].MEMBERS,

[Function].[Func Practice].[Func Practice Def].MEMBERS)'

AS'

(StrToMember("Measures.[" + Measures.CurrentMember.Name + "_]"),

StrToMember("[Practices].[Hierarchy].[Practice Class].&[Function Practice].&[" + [Function].[Func Practice Def].CurrentMember.Name + "]"),

[Function].[Func Practice].[All])'

I was wondering if:

a) Is a calculated cell the best solution?

b) Is there a more efficient MDX which can be used?

Thank you.

If I am understanding correctly, you have a measure called Budget_ which you want to be the budget at the All functions level. If this is correct the following scope should work and perform significantly better. All of the string and currentmember references would have been slowing things down.

SCOPE ({[Measures].[Budget]},

[Fiscal Date].[Fiscal].[Fiscal Mo].MEMBERS,

[Function].[Func Practice].[Func Practice Def].MEMBERS);

(Measures.[Budget_]) = ([Function].[Func Practice].[All], [Measures].[Budget]);

END SCOPE;

|||

Thank you for the reply Darren, I think this is a step in the right direction.

The budget fact table contains one dimension which accounts for all of our practices (this dimension is hidden from the users). What I want to be able to do is, based on a selected member from either of the visible industry practice or function practice dimensions, lookup the corresponding value in the practices dimesnsion and show the budget measure.

|||

If you're using AS 2005, you might consider an alternative approach, using many-to-many dimensions. But first (if I interpreted your scenario correctly) you would need to set up 2 "Practices" dimension security roles, 1 for users of Function and the other for users of Industry (both roles would have Visual Totals enabled). Role#1 would allow access to the "Function", and Role#2 to the "Industry" member, at the "Practice Type" level - these would also be the Default Members for the respective roles. This would ensure that Function users only access Function data and Industry users likewise. Role#1 would be denied access to the Industry dimension and Role#2 to the Function dimension.

For the many-to-many dimension modelling, there would be a bridge table (could be a named query) which maps Function dimension table rows to the Practices dimension, and a separate bridge table to map Industry. Once a measure group is created for each bridge table, 1 bridging Function and Practices and the other bridging Industry and Practices, both Function and Industry can be configured as many-to-many dimensions for the Budget measure group.

Calcualted Cells Performance Problem

Hello,

Initially the business divided its Practices into two groups, Industrial and Functional which were maintained in the relational source system as two seperate tables. The business has decided to expand the number of practices it reports on, however changes to the relational source system has not fully been implemented. We require reporting on the Budget data now so we've created a dimension named "Practices" which follows the same dimensional structure as the "Inudstry" and "Function" dimensions except that there is an extra parent level of "Practice Type". I would like to hide this new all inclusive "Practices" dimension from end users and effectively look up the corresponding value in the Industry or Function dimension from the Budget fact table.

I have the following calculated cell which achieves the desired results but has rather slow perforamce.

CREATE CELL CALCULATION CURRENTCUBE.[Budget Functional Practice]

FOR

'({[Measures].[Budget]},

[Fiscal Date].[Fiscal].[Fiscal Mo].MEMBERS,

[Function].[Func Practice].[Func Practice Def].MEMBERS)'

AS'

(StrToMember("Measures.[" + Measures.CurrentMember.Name + "_]"),

StrToMember("[Practices].[Hierarchy].[Practice Class].&[Function Practice].&[" + [Function].[Func Practice Def].CurrentMember.Name + "]"),

[Function].[Func Practice].[All])'

I was wondering if:

a) Is a calculated cell the best solution?

b) Is there a more efficient MDX which can be used?

Thank you.

If I am understanding correctly, you have a measure called Budget_ which you want to be the budget at the All functions level. If this is correct the following scope should work and perform significantly better. All of the string and currentmember references would have been slowing things down.

SCOPE ({[Measures].[Budget]},

[Fiscal Date].[Fiscal].[Fiscal Mo].MEMBERS,

[Function].[Func Practice].[Func Practice Def].MEMBERS);

(Measures.[Budget_]) = ([Function].[Func Practice].[All], [Measures].[Budget]);

END SCOPE;

|||

Thank you for the reply Darren, I think this is a step in the right direction.

The budget fact table contains one dimension which accounts for all of our practices (this dimension is hidden from the users). What I want to be able to do is, based on a selected member from either of the visible industry practice or function practice dimensions, lookup the corresponding value in the practices dimesnsion and show the budget measure.

|||

If you're using AS 2005, you might consider an alternative approach, using many-to-many dimensions. But first (if I interpreted your scenario correctly) you would need to set up 2 "Practices" dimension security roles, 1 for users of Function and the other for users of Industry (both roles would have Visual Totals enabled). Role#1 would allow access to the "Function", and Role#2 to the "Industry" member, at the "Practice Type" level - these would also be the Default Members for the respective roles. This would ensure that Function users only access Function data and Industry users likewise. Role#1 would be denied access to the Industry dimension and Role#2 to the Function dimension.

For the many-to-many dimension modelling, there would be a bridge table (could be a named query) which maps Function dimension table rows to the Practices dimension, and a separate bridge table to map Industry. Once a measure group is created for each bridge table, 1 bridging Function and Practices and the other bridging Industry and Practices, both Function and Industry can be configured as many-to-many dimensions for the Budget measure group.

Sunday, March 11, 2012

Cal Measure % against total

How to define calculated member whose value should be the row value divided by total of all rows. Example, sales of 2005 was 50k and sales for 2006 was 100k. The % 2005 sales is 33% of total (150k) and 2006 is 67%.

Hi

For example to get the percentage of the Unit Sales for one customer of all customers, you write:

[Measures].[Unit Sales] / ([Measures].[Unit Sales], [Customers].[All Customers])

The key is, to divide by a MDX tuple ([Measures].[Unit Sales], [Customers].[All Customers]) which brings the value for all customers.

Hans

|||

Thank Hans

This problem is solved. Please guide me to get the same result with multiple dimensions.

Also, i have a variance calculated member, which is on the date time diminsion [Sale of 2005] - [Sale of 2006] = [Variance 2005]. I would like to see three measures, [Year 2005 Sale], [Year 2006 Sale] and variance. But i get Sales and variance figure under Year 2005 and same under Year 2006. How to get the desired result.

Thanks

Shekhar

|||

Hi Shekhar,

I'm not sure, if I did understand you right, but I think it's because your [Variance] is on the Time Dimension. I do it in my projects so, that I create a calculated member like:

MEMBER [Measures].[Year variance] AS ([Measures].[Unit Sales],[Time].Currentmember.Prevmember) - [Measures].[Unit Sales]

If Currentmember is Year 2007, den Prevmember is Year 2006 and so on.

If you use now all 3 in a select, you can see it "flat"

select

{ [Measures].[Year 2005 Sales], [Measures].[Year 2006 Sale], [Measures].[Year variance]} on columns,

.....

Hans