Im tearing my hair out on this one.
Could anyone provide information on how to use the "TOP(N)" filter syntax? I
want to return the top 10 aggregate rows. Not sure if it can do this?
Please help!
Thanks
TazYou mean like this:
SELECT TOP 500 Client.CLI_LastName
from Client
"Tarun Mistry" <nospam@.nospam.com> wrote in message
news:%235obeed0GHA.1268@.TK2MSFTNGP02.phx.gbl...
> Im tearing my hair out on this one.
> Could anyone provide information on how to use the "TOP(N)" filter syntax?
> I want to return the top 10 aggregate rows. Not sure if it can do this?
> Please help!
> Thanks
> Taz
>|||Just try something like this in your dataset
SELECT TOP (10) SomeField, COUNT(*) AS count
FROM SomeTable
GROUP BY SomeField
ORDER BY count DESC
That will count the number or rows pertaining to that specific field and
then put them in order by the count, showing only the top 10
"Tarun Mistry" <nospam@.nospam.com> wrote in message
news:%235obeed0GHA.1268@.TK2MSFTNGP02.phx.gbl...
> Im tearing my hair out on this one.
> Could anyone provide information on how to use the "TOP(N)" filter syntax?
> I want to return the top 10 aggregate rows. Not sure if it can do this?
> Please help!
> Thanks
> Taz
>|||Hi guys, thanks for the responses.
I cannot change my query, therefore the filtering has to happen after the
dataset has been returned. This is because below my chart I will sumamrise
ALL of the informarion, however I only want the chart to display the top 10
entires (or whatever).
I thought i could do something like..
Count(Field!MyAggregate.Value) Top N 10
However this didnt do anything (that I could see).
Kind Regards
Taz|||another option is two have 2 datasets, make them the exact same except add
the top N statement to the dataset related to the chart and then have your
second dataset without the top N for the summary information. You would
still get the same info but from 2 different datasets.
"Tarun Mistry" <nospam@.nospam.com> wrote in message
news:%23xy8bre0GHA.4648@.TK2MSFTNGP04.phx.gbl...
> Hi guys, thanks for the responses.
> I cannot change my query, therefore the filtering has to happen after the
> dataset has been returned. This is because below my chart I will
> sumamrise ALL of the informarion, however I only want the chart to display
> the top 10 entires (or whatever).
> I thought i could do something like..
> Count(Field!MyAggregate.Value) Top N 10
> However this didnt do anything (that I could see).
> Kind Regards
> Taz
>|||Many thanks for your help Ben,
your previous post was the one I needed to make me realise where I was going
wrong.
Thanks again,
Taz
"Ben Watts" <ben.watts@.aaronnickellhomes.com> wrote in message
news:OG$qsue0GHA.4044@.TK2MSFTNGP04.phx.gbl...
> another option is two have 2 datasets, make them the exact same except add
> the top N statement to the dataset related to the chart and then have your
> second dataset without the top N for the summary information. You would
> still get the same info but from 2 different datasets.
> "Tarun Mistry" <nospam@.nospam.com> wrote in message
> news:%23xy8bre0GHA.4648@.TK2MSFTNGP04.phx.gbl...
>> Hi guys, thanks for the responses.
>> I cannot change my query, therefore the filtering has to happen after the
>> dataset has been returned. This is because below my chart I will
>> sumamrise ALL of the informarion, however I only want the chart to
>> display the top 10 entires (or whatever).
>> I thought i could do something like..
>> Count(Field!MyAggregate.Value) Top N 10
>> However this didnt do anything (that I could see).
>> Kind Regards
>> Taz
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment