Perculiar Named Calculations

In regards to this article about named calculations in SSAS, I had the perculiar finding today, that NULLs are handled somewhat differently than I would have expected.
In my case I had constructed a named calculation, just as in the article, by concatenating two columns, both of type string and allowing NULLs.
The perculiar part was, that when the second value was NULL, the whole expression would result in a NULL.
So, in order for the concatenation to succeed, the expression should be as follows:

[Marital Status] + CASE WHEN LEN([Has Children]) > 0 THEN  ’ ‘ + [Has Children] ELSE ” END

 

Skriv et svar

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Skift )

Twitter picture

You are commenting using your Twitter account. Log Out / Skift )

Facebook photo

You are commenting using your Facebook account. Log Out / Skift )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 66 other followers