Quantcast
Channel: Pentaho Community Forums
Viewing all articles
Browse latest Browse all 16689

boolean value displayed as Yes No

$
0
0
In a mondrian xml file, I have a dimension which is tied to a bit (boolean) datatype in a SQL Server table. While I understand how it works, it seems like there should be a better way.
We want the user to see "Yes" or "No" as the values. There will only be a 1 or 0 in the table (no nulls on the column). The developer coded it as
<KeyExpression>
<SQL dialect="mssql">
<![CDATA[
CASE WHEN IsPost = 0 THEN 'No'
WHEN IsPost = 1 THEN 'Yes' ELSE ''
END
]]>
</SQL>
</KeyExpression>

As a result of this coding, when a filter is selected on this dimension, the entire table is scanned, doing the CASE statement on every row.

Is there a way
  1. To indicate that the dimension will only have a 0 or 1 value (without having to scan)?
  2. To default a 0 to be labeled as "No" and a 1 as "Yes"?


Thanks

Viewing all articles
Browse latest Browse all 16689

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>