Quantcast
Channel: SQL Server Analysis Services Forum
Viewing all articles
Browse latest Browse all 2472

Problem with calculated dimensions in cubes

$
0
0

Hi

I am creating a calculated dimension which is based on one or more of the existing dimensions. For example consider the below expression for a calculated dimension:

CASE
     WHEN AcctOpen IS NULL OR ChargeOff IS NULL THEN
          'Data Not Provided'
     WHEN CAST(DATEDIFF(MONTH, AcctOpen, ChargeOff) AS DECIMAL(15, 2)) < 3 THEN
          'Less Than 3 Months'
     WHEN CAST(DATEDIFF(MONTH, AcctOpen, ChargeOff) AS DECIMAL(15, 2)) BETWEEN 3 AND 6 THEN
      '3-6 Months'
     WHEN CAST(DATEDIFF(MONTH, AcctOpen, ChargeOff) AS DECIMAL(15, 2)) BETWEEN 6 AND 12 THEN
      '6-12 Months'
     WHEN (CAST(DATEDIFF(MONTH, AcctOpen, ChargeOff) AS DECIMAL(15, 2))) > 12 AND
      (CAST(DATEDIFF(MONTH, AcctOpen, ChargeOff) / 12 AS DECIMAL(15, 2))) BETWEEN 1 AND 2 THEN
          '1-2 Years'
     WHEN (CAST(DATEDIFF(MONTH, AcctOpen, ChargeOff) AS DECIMAL(15, 2))) > 12 AND
      (CAST(DATEDIFF(MONTH, AcctOpen, ChargeOff) / 12 AS DECIMAL(15, 2))) > 2 THEN
          'More Than 2 Years'
END

Now suppose there is no fact value which lies in the '1-2 Years' slab, then that dimension value is not generated at all and is not shown in the cube browser as well in the SSRS report. I want the value '1-2 Years' to be shown as one of the dimension value and the fact '0' against it.

I have tried setting "Preserve"(as well as all the other possivle options)  for the NullProcessing attribute in the Properties window, but that does not help.

Please suggest a solution for this.

Thanks

NM


Viewing all articles
Browse latest Browse all 2472

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>