Monday, March 19, 2012

how to use parameters in mdx query

i have a problem with mdx query. here is a simple example of what i=B4m
trying to do
select {([Project_Owner].[Project Owner],[Date].[Year])}ON COLUMNS,
{([Customer].[Customer name])} ON ROWS
from [TestCube]
this query works fine... my problem is that the [Customer] dimension
has 3 members and i want to select just one of them, i tried to use
filter function, but it wasn=B4t working, i probably used it the wrong
way. can anyone help me with this? i=B4m working with sql server 2005...You should write it like this:
select {([Project_Owner].[Project Owner],[Date].[Year])}ON COLUMNS,
{([Customer].[Customer name].[BillyTheKid])} ON ROWS
from [TestCube]
The query with parameters should look like this:
="select {([Project_Owner].[Project Owner],[Date].[Year])}ON COLUMNS,
{([Customer].[Customer name].[" & Parameters!ClientName.Value & ")} ON ROWS
from [TestCube]"
Everything needs to be on a single line (it will do a line break, but if you
copy it to Notepad, it should all be on one line.)
Even if you're working with RS 2005, you might pick up some tips from an
article called
MSSQL Server Reporting Services: Mastering OLAP Reporting: Cascading Prompts
by William Pearson
http://www.databasejournal.com/features/mssql/article.php/10894_3386441_1
He's using RS 2000, but the way to do it is still similar. The good stuff
starts on page 8
http://www.databasejournal.com/features/mssql/article.php/10894_3386441_8
The previous pages are on how to copy and edit one of the sample reports.
Pearson has written lots of good articles on RS and Analysis Services. You
find the full list at http://www.databasejournal.com/article.php/1459531
Kaisa M. Lindahl Lervik
<cellardoor0716@.gmail.com> wrote in message
news:1155818962.580093.222920@.m79g2000cwm.googlegroups.com...
i have a problem with mdx query. here is a simple example of what i´m
trying to do
select {([Project_Owner].[Project Owner],[Date].[Year])}ON COLUMNS,
{([Customer].[Customer name])} ON ROWS
from [TestCube]
this query works fine... my problem is that the [Customer] dimension
has 3 members and i want to select just one of them, i tried to use
filter function, but it wasn´t working, i probably used it the wrong
way. can anyone help me with this? i´m working with sql server 2005...

No comments:

Post a Comment