Select different cube based on parameter
Hi Guys,
I'm having a problem possibly caused by solution's design. What happens is that I have one report and wish to access different cubes based on a parameter. These cubes have the same structure, but I figure that they cannot be merged because they threat different
areas and sum these totals makes no sense.
In fact, what I'm traying to do is parameterize the from clause of some datasets' MDX based on a parameter. Do you have any idea from how can I accomplish that? I'm accepting other sugestions, since I don't need to duplicate the report.
Thank you in advance.
[]'s
Rodrigo BatistaRodrigo Batista
May 31st, 2011 10:52am
I think you need to create two data sets and associate the data set to report control by using formula which validates the parameter value and then corresponding data set is attached.
Regards,Phani Note: Please vote/mark the post as answered if it answers your question/helps to solve your problem.
Free Windows Admin Tool Kit Click here and download it now
May 31st, 2011 11:13am
Actually there are a couple of options that could work for you.
#1) Dynamic MDX (do some Googeling to get the proper syntax).
#2) Use a SQL IF ELSE to place each of MDX queries into a single script, allowing only 1 query to execute at a time based on the parameter value
Kind of like...
IF @ParameterName = 'MDX_1'
BEGIN
>> MDX_1 query text <<
END
IF @ParameterName = 'MDX_2'
BEGIN
>> MDX_2 query text <<
END
IF @ParameterName = 'MDX_3'
BEGIN
>> MDX_3 query text <<
END
IF @ParameterName = 'MDX_4'
BEGIN
>> MDX_4 query text <<
END
Jason Long
May 31st, 2011 12:05pm
Hi ,
You Can Created a Dataset names Cube and Write a SQL Query which Will Fetch the Required Cube Name as a String depending on your Selection Like this..
GO
BEGIN
Declare @Value <<Datatype>>;
SET @Value=@Param1 ;
IF( @Value='xyz')
BEGIN
select 'Cube1' [Cube]
END
IF (@Value='xyz1')
BEGIN
Select 'Cube2' [Cube]
END
END
GO
After this you can use this Internal parameter (Internal Param ) to fectch the Main Data Like this...
="select {[Measures].[xyz] } on 0,
{Set} on 1
from " & "[" & @InternalParam.Value &"]"
Make sure you execute the MDX Statement with required Fiels First and then Make it as a Text like the Above one.
Mark it as Answered if found useful
Rakesh M J
Free Windows Admin Tool Kit Click here and download it now
June 1st, 2011 12:45am
Hi,
First you need to create Linked server and then use openqueries on the all the cubes and execute a particular openquery based on the parameter. Please let me know if you need more explanation on the same.
Regards,
Bharath
June 1st, 2011 2:20am
Hi ,
You Can Created a Dataset names Cube and Write a SQL Query which Will Fetch the Required Cube Name as a String depending on your Selection Like this..
GO
BEGIN
Declare @Value <<Datatype>>;
SET @Value=@Param1 ;
IF( @Value='xyz')
BEGIN
select 'Cube1' [Cube]
END
IF (@Value='xyz1')
BEGIN
Select 'Cube2' [Cube]
END
END
GO
After this you can use this Internal parameter (Internal Param ) to fectch the Main Data Like this...
="select {[Measures].[xyz] } on 0,
{Set} on 1
from " & "[" & @InternalParam.Value &"]"
Make sure you execute the MDX Statement with required Fiels First and then Make it as a Text like the Above one.
Mark it as Answered if found useful
Rakesh M J
Free Windows Admin Tool Kit Click here and download it now
June 1st, 2011 7:42am
Hi
Rodribat,
Here is a link refer to how to create a Dynamic MDX in Reporting Services with several parameters,
http://www.purplefrogsystems.com/blog/2008/09/dynamic-mdx-in-reporting-services/,
please take as a reference, and hope it can help you.
Thanks,
Eileen
June 2nd, 2011 4:49am
Hi ,
You Can Created a Dataset names Cube and Write a SQL Query which Will Fetch the Required Cube Name as a String depending on your Selection Like this..
GO
BEGIN
Declare @Value <<Datatype>>;
SET @Value=@Param1 ;
IF( @Value='xyz')
BEGIN
select 'Cube1' [Cube]
END
IF (@Value='xyz1')
BEGIN
Select 'Cube2' [Cube]
END
END
GO
After this you can use this Internal parameter (Internal Param ) to fectch the Main Data Like this...
="select {[Measures].[xyz] } on 0,
{Set} on 1
from " & "[" & @InternalParam.Value &"]"
Make sure you execute the MDX Statement with required Fiels First and then Make it as a Text like the Above one.
Mark it as Answered if found useful
Rakesh M J
<< Mark it as Answered if found useful >> Rakesh M J
Free Windows Admin Tool Kit Click here and download it now
June 6th, 2011 8:05am
Hi ,
You Can Created a Dataset names Cube and Write a SQL Query which Will Fetch the Required Cube Name as a String depending on your Selection Like this..
GO
BEGIN
Declare @Value <<Datatype>>;
SET @Value=@Param1 ;
IF( @Value='xyz')
BEGIN
select 'Cube1' [Cube]
END
IF (@Value='xyz1')
BEGIN
Select 'Cube2' [Cube]
END
END
GO
After this you can use this Internal parameter (Internal Param ) to fectch the Main Data Like this...
="select {[Measures].[xyz] } on 0,
{Set} on 1
from " & "[" & @InternalParam.Value &"]"
Make sure you execute the MDX Statement with required Fiels First and then Make it as a Text like the Above one.
Mark it as Answered if found useful
Rakesh M J
<< Mark it as Answered if found useful >> Rakesh M J
June 6th, 2011 3:02pm
I've tried this, but didn't found a way to associate different datasets based on a parameter.
The component property DataSetName doesn't allow to resolve this based on a expression.
Thank you!
[]'sRodrigo Batista
Free Windows Admin Tool Kit Click here and download it now
June 16th, 2011 8:01pm