I am facing a problem with the roll up of values in a dimension.
I have a dimension with 3 values at universe level. Letters
A
B
C
Now I want to add one more value to this dimension, which is D, but it should be sum of A+B. So list of values for new dimension should be: Letters
A
B
C
D
But when I am using case statement as follows:
case when Letters In (A,B) then D else Letters end
Then the Values for A & B getting disappeared.
I am getting result set like this: Letters
C
D
How can I get all the 4 letters to be displayed (i.e. results in 2nd case above) ?
SELECT Table1.Col1
FROM Table1
WHERE Table1.Col1 in ('A','B','C')
UNION
SELECT (Table4.A + Table4.B) AS D
FROM
(SELECT Table2.Col1
FROM Table2
WHERE Table2.Col1='A'
UNION
SELECT Table3.Col1
FROM Table3
WHERE Table3.Col1='B')Table4