Friday, March 30, 2012

Perspectives with ADOMD.NET and AMO

I am trying to filter our application's cube metadata list (measures, kpis, dimensions, etc.) by perspectives.

Unless I have totally missed something it appears that ADOMD.NET has 0 support for perspectives. You can not iterate measures, dimensions, etc. by perspective using ADOMD.NET. Can anyone verify this or correct me if I'm missing something?

While AMO can be used to iterate measures, dimensions, etc. by perspective, none of its PerspectiveDimension, CubeDimension, PerspectiveMeasure, etc. objects contain UniqueName fields. AMO does not seem to provide any UniqueName fields. Can anyone also verify this or correct me if I'm wrong?

I am currently having to utilize both ADOMD.NET and AMO in order to build the metadata list and support perspective filtering, and I keep thinking there has to be a better way! This is also requiring a LOT of For Looping in order to match up an object in ADOMD.NET to the corresponding object in AMO.

Thanks,
Terry

Perspectives are returned as regular cubes in ADOMD.NET. For browsing data, they are cubes, while from the metadata point of view they are separate entities, so they appear separately in AMO, but not ADOMD.NET.

UniqueName is indeed not exposed in AMO because it's not part of the objects definitions (aka metadata). For example, a DimensionAttribute in AMO doesn't have the UniqueName property, but when browsing the members of that attribute, each will have an UniqueName.

Adrian Dumitrascu

|||Hi Adrian,

Thank you for your help! I'm still a bit confused though. I can not find any property setting within ADOMD.NET to set the perspective that I want to restrict by. Your previous post led me to believe it might be setting on the AdomdConnection object and that thereafter everything would be restricted to that perspective; however, I have not been able to find that in the documentation. Would you please clarify for me how to restrict everything returned in ADOMD.NET to a given perspective?

Thank you,
Terry|||

If you want to define what measures, dimensions and/or attributes to include in a perspective, you need to use AMO. The Cube class in AMO has a collection of Perspectives.

After that, the perspective will appear as any other cube (in excel, or when browsing with ADOMD.NET or other browser), alongside the other cubes and perspectives.

If you want certain users to only see certain measures, dimensions or attributes, but not the rest of the cube, dimensions or attributes, then using a perspective is not the way to go. Perspectives are not a security feature, they are only used to customize the view of a cube. Instead you should define a Role for each category of users and then CubePermissions. That ensures that certain users only see the data they are allowed.

|||Thanks Adrian! I wasn't expecting the perspective to show up as their own cubes, so I didn't look in the ADOMD.NET cube collection.

For others that need to know this, you can iterate all the perspectives of a given cube by looking at adomdConnection.Cubes(i).Properties("BASE_CUBE_NAME") = "My Real Cube" and then use each of those Cube objects to find the perspective-specific measures, dimensions, etc.

Thanks again,
Terry

No comments:

Post a Comment