Search code examples
sqlssascubesql-server-data-toolsolap-cube

Transform Numbers to Text


A field in my cube contains numerical values which I would like transformed and displayed as text.

For example

1 is a sale 2 is a return

etc

Is a named caculation best?


Solution

  • Easiest way to do this would be with a case statement,

    SELECT 
       CASE someValue
          WHEN 1 THEN 'sale' 
          WHEN 2 THEN 'return' 
       END
    FROM MyTable ;