?
Solved

Create case statement in SSAS OLAP design

Posted on 2008-10-10
9
Medium Priority
?
1,325 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
9 Comments
 
LVL 8

Accepted Solution

by:
srnar earned 2000 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

743 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