SQL Server Analysis Services - using IgnoreUnrelatedDimensions

143 views Asked by At

I have a question about the possiblity of show a message in case of having unrelated dimensions.

I'm using the IgnoreUnrelatedDimensions FALSE to have null or blank values, but I'm investigating about the possibility of showing some message when it happens instead of null or blank values. It's possible to do that?

1

There are 1 answers

0
Ferdipux On

You can do it; however, I vote against it. See review of proposed solution below. Solution is possible with SCOPE statement, but with some limitations.
Assume you have a cube with two dimensions, A and B and a measure M, not related to dimension B. Also, dimension B has two attributes, b1 and b2. Then you can design the following SCOPE statement

SCOPE ([Measures].[M]);  
    SCOPE([Dim B].[b1].[b1]); THIS="message"; END SCOPE;
    SCOPE([Dim B].[b2].[b2]); THIS="message"; END SCOPE;  
END SCOPE;  

This SCOPE will show message when you try to add analysis on b1 or b2 attribute. Note [Dim B].[b1].[b1] - we do not want our scope message show at [Dim B].[b1].[All] member.
Now let's review disadvantages of this approach.

  1. You have to list all hierarchies of all unrelated dimensions. Tedious and error prone.
  2. If you add both Dim A and Dim B to your query, figures will show only at Dim B aggregate level.

Basically, this solution replaces total figure of IgnoreUnrelatedDimensions=true with custom message at price of manually listing all unrelated dimensions and its hierarchies.