There is a way to use an arbitrary parameter in OLAP Report (not associated with a dimension)?

I'm using a lot of parametrized reports. But yesterday I want to make a report which takes a boolean parameter to do something like this:
WITH
MEMBER [Measures].[ShowU$SMeasure] AS ''+@show+''
MEMBER [Measures].[ShowingData] AS 'IIF([Measures].[ShowU$SMeasure], [Measures].[Amount], [Measures].[Tons])'
...
...
...

If I pass true then show U$S else Tons. But the report want to associate a parameter with a dimension.
Finnaly I solved this from the report, adding 2 calculated fields.
But this runs slower than the first thought.
Another thing I couldn't do was to put a parameter in a datetime picker and format the date to use it ina a parameter to the MDX. Because the DATASET always expect that the parameter is associated with a dimension.
Why always a parameter has to be associated with a dimension
Any ideas
Thanks in advance


Answer this question

There is a way to use an arbitrary parameter in OLAP Report (not associated with a dimension)?

  • swfisher

    I am not sure I quite understand your problem. But this is how I have been passing date parameter for extracting data from a cube.

    I create a stored procedure which takes the date along with other parameters and creates an mdx query dynamically . Then it uses an linkied server to fire the mdx query and returns a flat resultset to the report .

    I used DateTime.Today.AddDays(-1) for the defaultvalue of the datetime parameter , as I needed it to open to yesterday's date.

    Cheers

    Shai


  • pierreg

    I have been having a similar problem trying to get arbitrary parameters into an MDX query. I find that there are 2 separate areas to control parameters in RS2005.

    1. The main parameters collection for the report - accessed by the menu (Report-> Report Parameters).
    2. The parameters collection for the query - accessed via the dataset toolbar (icon with the @ sign).

    There are a few annoying things going on here:

    • If you set the parameter only in the main parameters collection (not the query collection), then your query does not recognise it.
    • The two collections of parameters can get out of sync - have different defaults etc.
    •  The query parameters collection requires that the parameter comes from a dimension - which is a problem if you want to do something a bit outside the box.
    • Whenever you alter the parameters in the main query, RS2005 generates MDX to produce a list of the allowable parameter values. This is very annoying if you have a large number of values as the auto-generated MDX makes the whole report very slow. RS insists re-creating these queries even when you set the parameter to hidden and/or manually delete the generated MDX and/or say that allowable values do not come from a query. This is also a problem when you want to hand-code the allowable values

    I would like to know whether anyone else finds these issues a problem

    Personally I find the tight binding of parameters to hierarchies and the auto-generation of MDX to be a major headache - no doubt well intentioned but it has cost me a lot of time undoing what RS has helpfully done.

     


  • Fraze

    Are you using SQL 2005 The AS parameterization only works with dimension members, I believe. In general, I don't think you can filter on measures but this is more of an MDX question. You might try posting it in the AS forum.

  • Ldannyboy15

    It isn't an MDX question, because I'm actually doing that. I think it's only a formalitty that RS associates a parameter with a member, because when you whant to use the parameter you have to use STRTOMEMBER or STRTOSET. Then why it expects to associate a string with a member I want to pass some other parameter which isn't associated with a dimension, it's used for doing some calculation.
    Because that, I have to do this in the report instead in the query. Why I whant to do taht Easy MDX query is faster than report!!!

    I will try to do this selecting any dimension member and pass the parameter I want.
    Later I'll tell you!!!

  • tower05

    I want to pass an arbitrary parameter to do some calculation. But when you define a parameter always expecto to associate it with a dimension and I don't want to....

    I want to pass for ex a boolean parameter.
    Thanks

  • There is a way to use an arbitrary parameter in OLAP Report (not associated with a dimension)?