Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Filter on measures in MDX query on SSRS

i've creted a report using a cube as datasource and MDX query on my dataset. i have a few measures in my dataset but i want to show wonly the rows with at least one of the measures > 0, using something like an OR filter (measure1 >0 or measure 2 >0 ..etc) how can i do this?

thanks

like image 560
user1508682 Avatar asked Mar 01 '13 17:03

user1508682


People also ask

How do you use filters in MDX?

The Filter function evaluates the specified logical expression against each tuple in the specified set. The function returns a set that consists of each tuple in the specified set where the logical expression evaluates to true. If no tuples evaluate to true, an empty set is returned.

How do I apply a filter in SSRS?

To edit the expression, click the expression (fx) button. From the drop-down box, select the data type that matches the type of data in the expression you created in step 5. In the Operator box, select the operator that you want the filter to use to compare the values in the Expression box and the Value box.

How do you pass multiple parameters in MDX query?

Select "Allow multiple value" option in General tab of Parameter Properties window. Set Available values like below. Use STRTOSET instead of STRTOMEMBER in the main report.

How do you declare a parameter in MDX query?

To define a query parameter in MDX in Query modeOn the toolbar, click Design to toggle to Query mode. ). The Query Parameters dialog box opens. In the Parameter column, click <Enter Parameter>, and then type the name of a parameter.


1 Answers

Use the Filter() clause to constrain the memberset for the rows:

SELECT
  [Measures].[Internet Sales Amount] ON COLUMNS,
  Filter(
    [Customer].[Country].Members, 
    ([Measures].[Internet Sales Amount] > 2000000) 
        AND ([Measures].[Internet Sales Amount] < 5000000)
  ) ON ROWS
FROM [Adventure Works];
like image 185
findango Avatar answered Oct 14 '22 17:10

findango