Showing posts with label cube. Show all posts
Showing posts with label cube. Show all posts

Thursday, March 29, 2012

Default member problem

Hi,

I have Employee dimension with DomainName attribute which is used for role - based access to cube data.

I've tried to set DefaultMember using MDX expression and username function, like this:

IIF(StrToMember('[EmployeeDim].[DomainName].&[' + username + ']') IS NULL,[EmployeeDim].[DomainName][All], [EmployeeDim].[DomainName].&[' + username + ']')

but when I try to deploy this dimension I've got error message "The level '&[PEXIMBG\borko.novakovic]' object was not found in the cube when the string, [EmployeeDim].[DomainName].&[PEXIMBG\borko.novakovic], was parsed" when there is no any EmployeeDim member which have my username defined!

I thought that usage of IIF will resolve this error, but did not.

Is there any advice or hint how to avoid this behavior, because it is not common case that cube developer is member of EmployeeDim dimension which is populated from customer table.

Thanks in advance

Borko

How about if you test StrToMember() for an error in IIF(), rather than for Null, like:

IIF(IsError(StrToMember("[EmployeeDim].[DomainName].&[" + username + "]")),

[EmployeeDim].[DomainName][All],

StrToMember("[EmployeeDim].[DomainName].&[" + username + "]"))

|||

It works great!

Why IsError is not described in SQL Server Books Online?

I'm new in MDX and I did not know how to prevent engine to raise an error.

Anyway, Deepak, thank you very, very much!

Thursday, March 22, 2012

Default cube view in SSMS?

Hi,

When browsing a cube in management studio, is there a way set up default value in PivotTable?

Let’s say the cube has 20 dimensions and 10 measures, but user see 2 dimensions and one measure more often; when open a cube, can SSMS just show the default view (2 dimensions and one measure

Thanks in advance.
You can create a perspective with just the 2 dimensions and the measure more used. However, SSMS nor Excel will use one as the default (I think). Of course, if you a Pivot Table for the new perspective is just a question of refreshing that PT.|||
Thank you very much Tiago, your information is very helpful.
I really appropriated.

|||

SSMS is not a tool for end user.

If you, as administrator, want to see some predefined MDX queries you constuct it once then intercept the MDX with profiler and save the MDX in file. Then you can call those MDX queries in SSMS every time you want.