Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Dynamic MDX problem in SSRS2005

Posted on 2010-09-01
4
Medium Priority
?
1,129 Views
Last Modified: 2016-02-15
I have the following problem: I need to create dynamic mdx query to SSAS 2005 in SSRS 2005.
I'am creating dynamic mdx query with the help of embedded code ant it's ok. The code returns three dimensions and two measure columns. These three dimensions are being genenerated in my code dynamically. The problems begin when I need to assign column name in dataset. I can't make alias for returning dimensions like in SQL (select column as 'aaa'). I've tried to generate column name in dataset dynamically but unfortunately it didn't work.
Value for field assign in SSRS dataset for OLAP source loks like: <?xml version="1.0" encoding="utf-8"?><Field xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:type="Level" UniqueName="[Dim Dimension].[Dimension]" />. If i generate it in code and assign in dataset it doesn't work.
Another decision which I tried is to generate these columns through the following code:
with member Measures.RowGroup1 as [Dim Dimension1].[Dimension1].CurrentMember.Member_Caption
member Measures.RowGroup2 as [Dim Dimension2].[Dimension2].CurrentMember.Member_Caption
member Measures.RowGroup3 as [Dim Dimension3].[Dimension3].CurrentMember.Member_Caption
SELECT non empty
 {
      Measures.RowGroup1,
      Measures.RowGroup2,
      Measures.RowGroup3,
      [Measures].[Num]
      , [Measures].[Amt]
} ON COLUMNS
, non empty
(
      [Dim Dimension1].[Dimension1].[Dimension1].MEMBERS
      ,[Dim Dimension2].[Dimension2].[Dimension2].MEMBERS
      ,[Dim Dimension3].[Dimension3].[Dimension3].MEMBERS
  ) ON ROWS  .
When I use it for one dimension it's ok, but using all these measures together make mdx query running forever.
Does anyone know any solution for this problem?
0
Comment
Question by:JekaCh
[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
  • 2
  • 2
4 Comments
 
LVL 15

Expert Comment

by:Tim Humphries
ID: 33577699
Hi,

Are you generating a matrix report? If not, then rather than trying to return the column names in the query, can you not use similar logic to that used to build the query to dynamically change the column header names in the report layout?

So in your column headers you would call a function =Code.GetFirstColumnName etc.
I don't think you'll get far trying to get the column names back dynamically in your MDX, unless you used a third party tool such as Intelligencia maybe, but that costs £

Tim
0
 

Author Comment

by:JekaCh
ID: 33579285
Thanks for your comment, but the problem is not in creating column names in matrix report layout but in creating column definitions in dataset. Because as I described above in SSRS I unfortunately have to set  each column returning by query its name. And for OLAP source it seems can't be generated in code.
0
 
LVL 15

Accepted Solution

by:
Tim Humphries earned 2000 total points
ID: 33582328
0
 

Author Comment

by:JekaCh
ID: 33590352
Thank you Tim this solution helped but I've earned new security problems because is seems that only user in sysadmin role could execute openrowset queries. Th following link helped me to solve this problem:
http://www.kodyaz.com/articles/enable-Ad-Hoc-Distributed-Queries.aspx
http://support.microsoft.com/kb/328569 - it works not just for SQL Server 2000 but for at least 2005 too.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
Lotus Notes has been used since a very long time as an e-mail client and is very popular because of it's unmatched security. In this article we are going to learn about  RRV Bucket corruption and understand various methods to Fix "RRV Bucket Corrupt…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

610 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