Sunday, February 19, 2012

Create Dynamic Query based on Report Parameter

I have one Report parameter "Query1". I want to create Dynamic Query, How can I do this?

ex. If I select Station in Query1 parameter then report should generate by Station Dimenstion attribute

[Dim Station].[Station Name].[Station Name].ALLMEMBERS

If I select Free Test in Query1 parameter then report should generate by Free Test Dimension attribute

[Dim Free Test].[Free Test].[Free Test].ALLMEMBERS

My existin query is below:

SELECT NON EMPTY ([Measures].[Total Test Count]) ON COLUMNS,

NON EMPTY STRTOSET(@.Query1) * [Dim OverallResult].[Overall Result].[Overall Result] ON ROWS

FROM [OLAP Test Cube]

Report Parameter Name: Query1

Available Non Queried value in Report Parameter is below:

Lable Value

Station [Dim Station].[Station Name].[Station Name]

Free Test [Dim Free Test].[Free Test].[Free Test]

Default Value is below:

Non-Queried value: [Dim Free Test].[Free Test].[Free Test]

I want to Change Column Alias also through Select MDX Query.

let me know if anybody know this?

anyone know about this?|||

This http://www.databasejournal.com/features/mssql/article.php/10894_3504651 article should give you an idea how to use parameters building MDX queries in Reporting Services.

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

|||

this is not working for me. any other solution?

in this example they added Dimension member in filter area. I need different dimension in filter area.

No comments:

Post a Comment