Top N not distinct rows

  • Hi all,

    In the report I have a column revenue and I need to create two separate reports where this column will be sorted in ASC and DESC order and I need display only TOP 15 rows.

    I used this formula:

    =IIF(RunningValue(Fields!Revenue.Value, Count,"Tablix4")<= 15, False, True)

    But this expression returns the wrong results. When I used this expression: =IIF(RunningValue(Fields!Revenue.Value, Count,"Tablix4")<= 15, False, True)

    everything is OK, but the values that have the same revenue are filtered and displayed only one values.

    Could you help me ,please?

  • I would just add TOP 15 to the query and drop the IIF.  TOP 15 will give you whatever the first 15 values are, including duplicates.  This also has the advantage that the data is filtered before being passed to SSRS, instead of passing a potentially large chunk of data that is then filtered.  In this scenario, Sort order would be a parameter in the query (ASC or DESC).

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply