Solved

Create case statement in SSAS OLAP design

Posted on 2008-10-10
9
1,319 Views
Last Modified: 2013-11-16
I am trying to build a calculated member for an OLAP cube using Micro Soft Analysis Services.  The attributes hold a boolean value.  Basically I want to create a  case statement which looks at the boolean value in 5 attributes and if the value is true in Attribute1then 'descriptor01', if the value is true in Attribute2 then 'descriptor02'  ... to Attribute5.  The aggregation at the various descriptor levels will always be more than the count of records as a record can have a true boolean value in more than one of the 5 dimensions.
0
Comment
Question by:Mocha_Joe
  • 3
  • 2
9 Comments
 
LVL 8

Accepted Solution

by:
srnar earned 500 total points
ID: 22693821
You can use a calculated measure that detects values of the attributes and changes its value e.g.

with member Measures.DescriptorMeasure
as
case when left(Customer.[Customer Geography].CURRENTMEMBER.NAME,1)="A"
      then "destriptor01"
      else "destriptorOther"
end
select {[Customer].[Customer Geography].[Postal Code].&[3280]&[Warrnambool].children} on rows,
{Measures.DescriptorMeasure} on columns
from [Adventure Works];
0
 

Author Comment

by:Mocha_Joe
ID: 22964495
Is it possible to add this as a hierarchy to the dimension in the Anaysis services design where it will show in the browser of a cube or if you use excel to view the local cube?  I do not want to write in a query editor in Analysis Services.  I want to add to the .sln a hierarchy that will do this.   I have seen this done with 'Data Beacon'.  Please advise
0
 
LVL 8

Expert Comment

by:srnar
ID: 22964955
Put your CASE logic into the relational layer. Than you can easily set a hierarchy based on a multiple attributes logic. I don't know Data Beacon - do you mean that reporting tool?
0
 

Author Comment

by:Mocha_Joe
ID: 22979439
Yes, Data Beacon the reporting tool.  It builds the mdx behind closed doors.   Do you mean add the CASE logic the Data Source View when you refer to 'relational layer' or do you mean build a hierarchy based on the 5 separate attributes ?
0
 
LVL 8

Expert Comment

by:srnar
ID: 22982734
Yes - the new hierarchy would use that attributes. I prefer the database view but you can use the data source also for case logic implementation.
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Working with SharePoint Data 8 62
append to an ms access field 6 43
Mongo DB 18 62
Is Dropbox the only way to upload large files? 3 44
This article describes some very basic things about SQL Server filegroups.
This article explains all about SQL Server Piecemeal Restore with examples in step by step manner.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question