Translating True or False into another language

  • I have a requirement in which a bit field should display True or False in another language while browsing an SSAS 2016 cube.  In my data warehouse I have a field, IsPremCustomer, defined as a bit so you get a 1 or 0, True or False field.  However the trouble is that when this dimension gets deployed to SSAS it displays exactly that:  True or False, even if the user is viewing the report in French.  I realize that translations/localizations affect the metadata and not the contents of the database so I've come up with the following solution:

    - Inside the Data Source View, create a calculated column, IsPremCustomerTranslation, that returns a string and then add this column to the dimension instead of IsPremCustomer:
    case when IsPremCustomer= 0 then 'Faux' else 'Vrai' end

    My reservations about this solution is that I get a string instead of a bit to fulfill the requirement.  Is there a better way to do this?  One in which I could maintain the bit type but also get True or False to be displayed in French.  The contents should always be in French so it doesn't matter what language the user selects.

    I realize this is a very unusual requirement as I haven't had something like this in my almost 10 years of working in the IT Industry but I would appreciate any help or advice.

  • Addicted2SQL - Wednesday, June 21, 2017 2:13 AM

    I have a requirement in which a bit field should display True or False in another language while browsing an SSAS 2016 cube.  In my data warehouse I have a field, IsPremCustomer, defined as a bit so you get a 1 or 0, True or False field.  However the trouble is that when this dimension gets deployed to SSAS it displays exactly that:  True or False, even if the user is viewing the report in French.  I realize that translations/localizations affect the metadata and not the contents of the database so I've come up with the following solution:

    - Inside the Data Source View, create a calculated column, IsPremCustomerTranslation, that returns a string and then add this column to the dimension instead of IsPremCustomer:
    case when IsPremCustomer= 0 then 'Faux' else 'Vrai' end

    My reservations about this solution is that I get a string instead of a bit to fulfill the requirement.  Is there a better way to do this?  One in which I could maintain the bit type but also get True or False to be displayed in French.  The contents should always be in French so it doesn't matter what language the user selects.

    I realize this is a very unusual requirement as I haven't had something like this in my almost 10 years of working in the IT Industry but I would appreciate any help or advice.

    I'm not sure if there is a way of translating members of attributes without physically having the data in the source (or as you have done, in a calculation). This does not mean that you can't use the BIT type still though. Have the attribute key column set to your BIT column and then set the name/value column properties to be the translated name.
    If you wanted more flexibility then you could create multiple translations in the source/as calcs and then create an attribute relationship between your bit column and these translations. Hide the translation attributes and then teach the users how to access the properties of the True/False attribute to reveal the different translations.
    Someone might know of a better way but those are the options that I can think of right now.


    I'm on LinkedIn

  • I remember that AdventureWorks has an example on how to do this in SSAS. I don't have it installed right now, but you should check it.
    Here's an article from BOL explaining it: https://docs.microsoft.com/en-us/sql/analysis-services/lesson-9-2-defining-and-browsing-translations

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply