Solved

Create case statement in SSAS OLAP design

Posted on 2008-10-10
9
1,313 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Database tuning – How to start and what to tune. This question is frequently asked by many people, both online and offline. There is no hard and fast rule-of-thumb for performance tuning, however, before beginning the tuning process one should a…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
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…

708 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now