Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Top N filter for an MDX DataSet in Reporting Services

Posted on 2004-08-18
3
Medium Priority
?
754 Views
Last Modified: 2008-01-09
Reporting Services: Can you please tell me how do I use the filter option from the DataSource tab in order to retrieve the top N records from the dataset.

I tried several ways, see below, none of them work, I keep getting the error that "cannot evaluate filterx expression/filter values".

<DataSets>
    <DataSet Name="FoodMart_2000">
      <Fields>
        <Field Name="Category_Category_Description">
          <DataField>[Category].[Category Description].[MEMBER_CAPTION]</DataField>
          <rd:TypeName>System.String</rd:TypeName>
        </Field>
        <Field Name="Measures_Amount">
          <DataField>[Measures].[Amount]</DataField>
        </Field>
      </Fields>
      <Filters>
        <Filter>
          <FilterExpression>=RowNumber()</FilterExpression>
          <Operator>TopN</Operator>
          <FilterValues>
            <FilterValue>2</FilterValue>
          </FilterValues>
        </Filter>
      </Filters>
      <Query>
        <DataSourceName>FoodMart 2000</DataSourceName>
        <CommandText>select
{[Measures].[Amount]} on columns,
{[Category].[Category Description].Members} on rows
FROM
Budget</CommandText>
      </Query>
    </DataSet>

or with:

       <Filter>
          <FilterExpression>=Fields!Category_Category_Description.Value</FilterExpression>
          <Operator>TopN</Operator>
          <FilterValues>
            <FilterValue>2</FilterValue>
          </FilterValues>
        </Filter>

0
Comment
Question by:lentzi
3 Comments
 

Author Comment

by:lentzi
ID: 11900501
Found the answer on Microsoft's forum, but I will leave it here for the others:
<Filter>
          <FilterExpression>=Fields!Category_Category_Description.Value</FilterExpression>
          <Operator>TopN</Operator>
          <FilterValues>
            <FilterValue>=2</FilterValue>
          </FilterValues>
        </Filter>
0
 
LVL 1

Accepted Solution

by:
DarthMod earned 0 total points
ID: 12142695
Submitted to PAQ with points refunded (500)

DarthMod
Community Support Moderator
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question