Electronic Circuit
Electronic Circuit

Reputation: 335

How to limit the return results using MDX query

I am using MDX query to limit the huge results from my query using the following but it doesn't work. My intention is to limit the result to 10 only to reduce the loads

SELECT {[Measures].[activityduration]} ON COLUMNS,
       {([rig], 10)} ON ROWS 
FROM activityhours

The error says:

The following is not a valid MDX query: No function matches signature '(<Dimension>, <Numeric Expression>)'

Can anybody helps?

Upvotes: 2

Views: 3516

Answers (2)

SouravA
SouravA

Reputation: 5243

If you mean limit to 10 rows of rig(since you talked about huge number of records), then below should help:

SELECT {[Measures].[activityduration]} ON COLUMNS,
       TOPCOUNT([rig], 10) ON ROWS 
FROM activityhours

It would be first 10 values from [rig] in natural order.

Upvotes: 5

whytheq
whytheq

Reputation: 35557

What does "limit the result to 10" mean exactly? Limit to 10 rows, or do you want to filter [rig] somehow based on 10?

I've guessed you just want members of [rig] where [Measures].[activityduration] is equal to 10:

 SELECT {[Measures].[activityduration]} ON COLUMNS,
       [rig] 
         HAVING Measures].[activityduration] = 10 
          ON ROWS 
FROM activityhours;

Upvotes: 0

Related Questions