How to: ..WHERE STRTOSET(@p1), STRTOSET(@p2)

Question!

I am trying to filter a query by two (multi select) parameters.

It works fine when doing this for the first one, but complains when I add the the second one.

Is my syntax wrong is there a better way to achieve what I want?



Answers

Tried subqueries?

SELECT
    [Measures].[YourMeasure]
ON COLUMNS,
    [Dimensions].[YourDimension]
ON ROWS 
FROM

(SELECT STRTOSET(@p1) ON COLUMNS FROM
(SELECT STRTOSET(@p2) ON COLUMNS FROM   

[YourCube] ) )
By : Meff


MDX WHERE has very little in common with SQL WHERE. MDX WHERE does not effect the number of rows that return, just which cube slice the cells are to be retrieved from.

I would use the FILTER function since a MDX WHERE clause must be a tuple (cell address), no more no less, i.e.,

(Dim1.Member, Dim2.Member, etc.)

Hope this helps.

By : ajdams


This video can help you solving your question :)
By: admin