Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: boolean value displayed as Yes No

  1. #1
    Join Date
    Feb 2013

    Default boolean value displayed as Yes No

    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
    <SQL dialect="mssql">
    CASE WHEN IsPost = 0 THEN 'No'
    WHEN IsPost = 1 THEN 'Yes' ELSE ''

    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"?


  2. #2
    Join Date
    Nov 2008


    I think it would be more efficient to use a "format string" or a user-defined "formatter" instead of a KeyExpression.
    Java 1.7 (64 bit)
    MySQL 5.6 (64 bit)
    Windows 7 (64 bit)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2017 Pentaho Corporation. All Rights Reserved.