This project has moved and is read-only. For the latest updates, please go here.

Find values for attribute labels

Topics: Developer Forum
Mar 21, 2013 at 5:43 PM
Edited Mar 21, 2013 at 6:09 PM

I am using call assp.discoverxmlmetadata("Database\Dimensions\Dimension\Attributes*") to retrieve my attribute names and their back end column mappings to dynamically create views. I ran into a bit of a snag when I have a label in place. So my question is, how if at all can I determine through this call or another that a column is a label and from there, find the definition of said value?

Mar 21, 2013 at 6:27 PM
What do you mean by "label"?
Mar 21, 2013 at 6:29 PM
Within an SSAS dimension, you can create a label. In our case, we use labels to concatenate two columns together.

For example a label named "Customer" is simply CustNum + CustName.
Mar 21, 2013 at 6:42 PM
Meaning that you have an attribute called Customer which has a NameColumn called MyCalcColumn. If you then look in the DSV you see a calculated column which uses the expression CustNum + CustName?

If that's what you mean, it's complex. The DSV could point to a table and then add a calculated column defined in the DSV. Or the DSV table could be a named query with the MyCalcColumn defined in the T-SQL of the named query.

I've never tried to query the DSV tables and columns using DiscoverXmlMetadata. Let us know if you make progress.

If that doesn't work, then you could write your own .NET sproc and use AMO to access the DSV. You might be able to look at the following code:

See near the line of code which says:
if (!dc.ExtendedProperties.ContainsKey("ComputedColumnExpression"))

If others have suggestions, feel free to post them.