US and Worldwide: +1 (866) 660-7555
Results 1 to 2 of 2

Thread: boolean value displayed as Yes No

  1. #1
    Join Date
    Feb 2013
    Posts
    4

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

  2. #2
    Join Date
    Nov 2008
    Posts
    777

    Default

    I think it would be more efficient to use a "format string" or a user-defined "formatter" instead of a KeyExpression.
    pdi-ce-4.4.0-stable
    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
  •