Wednesday, March 7, 2012

Defining a boolean dimension attribute

What's the best way to go about defining a dimension attribute for a boolean data value in SSAS 2005? In our first cut, we used a bit column in the database, but that results in dimension members of 0 and -1, and we'd rather have "true" and "false" displayed in the OLAP browser. In there an easy way to have SSAS map the bit values to the boolean strings?

You can create a named query in DSV to map the values on the fly.

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

|||Edward,
Thanks for the response. I did think of that solution, but it has a problem for me. As an ISV, our product needs to be localizable, and embedding string translations in the DSV presents a localization problem.

When I do a query against a bit column using SQL Server Management Studio, it displays the contents as true/false, and in the DSV the column data type is displayed as "boolean". So it seems strange to me that SSAS can't do that string conversion automatically. Perhaps in a future release - I'll report an enhancement request for it.

I ended up solving the problem by snowflaking in a "BooleanValues" table which contains members (and corresponding names) for true and false.

|||For posterity, this looks like it's an actual bug in SSAS when using the managed SqlClient provider. When you switch the data source to use the SQL Native client, bit column values are translated to true/false automatically. I've reported it on Product Feedback.

1 comment:

itssanju said...

I ended up solving the problem by snowflaking in a "BooleanValues" table which contains members (and corresponding names) for true and false. how did you do that..

Post a Comment