parameters from cube allowing multiple values
Hey folks,
Question on parameters. I have 5 shared datasets in my SSRS-project. My default value pops up as [Client].[Client_number].[All]
I have gotten many error messages due to this parameter. I am able to make it work with opting only one parameter value at a time. In this case I have adjusted the parameter as follows
="[Client].[Client_number].&["&Parameters!Clientnumber.Value &
"]&[FIN]".
However, I wish to pick multiple values and also it would be great to show list of available values (1,2,3,4,5,6...without any text). What would be a best way to implement this with adjusting parameter properties? (I am building my dataset with
the query designer in SSRS).
I hope someone can help me. I am in desperate need of help:)
May 18th, 2011 7:50am
Hi Shauna:
Should you always get the FIN member for any Client?
Can you also explain "show list of available values (1,2,3,4,5,6...without any text)"? I don't understand the
"without any text" part.
If I understand you right, here's what you want to do:
- Have a drop down with all the Client Numbers.
- User can select 1 or many values and for every selection ClientNumber selected, you need to show the FIN member.
Assuming my understanding is right, you can do the following:
- Create a Query Parameter named QClientNumber and set its expression to the following:
=IIF (
InStr (Parameters!ClientNumber.Value, "[Client].[Client_number].[All]"),
"[Client].[Client_number].[All]",
"[Client].[Client_number].&[" &
Replace (
Join (Parameters!ClientNumber.Value, ","),
",",
"]&[FIN],[Client].[Client_number].&["
) &
"]&[FIN]"
)
- Use the Query Parameter in your MDX as STRTOSET (@QClientNumber)
Please Note: I havent tried the expression anywhere. I scripted it in Notepad. So you might want to check it once.
I don't know if this is of help, but will be able to help you with more info from your end.
Cheers.Please mark correct answers :)
Free Windows Admin Tool Kit Click here and download it now
May 18th, 2011 9:16am
Thank you for your help. The FIN part is just that I decided on my dataset that I only wish to include finnish client numbers.Therefore, the value field on MDX is
"[Client].[Client_number].[FIN]". However,
I do not need to include 'FIN' in the list of numbers.
I still get a blank list when implementing this. What should I have on the parameter properties in the available values section? As I understand it, I should have the IIF-expression in the dataset/parameter value field.
May 18th, 2011 3:03pm
You can embbed a custom code in your report. This was my solution.
I have used TSQL for populating my parameters and then trensform TSQL code to MDX by custom code.
This is also the best option for multiple value parameter.
You can transform string that you need with custom code (example below). So you populate your param with TSQL values, where you can use lables by your choise and then transform those values to MDX by custom code.
For multiple value param the MDX string should be within bratckets {} and values should be separated with cooma - look at the code.
Function GetParam(Param()) As String
Dim Braker As String
Braker = ", "
Dim TE As String
TE = "[Client].[Client Number].&"
Dim Output As String
Dim i As Integer
For i = 0 To UBound(Param)
Dim Current As String
Current = CStr(Param(i))
Output = Output & TE & "[" & Current & "]" & Braker
Next
Output = Left(Output, Len(Output) - Len(Braker))
GetParam = "{" & Output & "}"
End Function
Free Windows Admin Tool Kit Click here and download it now
May 19th, 2011 3:56am


