Showing posts with label category. Show all posts
Showing posts with label category. Show all posts

Wednesday, March 7, 2012

Charts: Using Top N but need to show 'Others' as one

Hi all
I'm generating a column chart, lets say its CustomerID as a category
and SUM(Sales.Value) as a values sorted by SUM(Sales.Value) DESC. That
might give 100 column bars so we filter the category to show, say, Top
20.
Can anyone see a way, convoluted or otherwise, of creating one more
column bar to represent SUM(Sales.Value) for the other 80.
I just want to be sure that I'm not missing something before I dive
into writing code that creates a temporary table to report on which is
the only way I can see.
Cheers
RossAFAIK there is no function for "others". Perhaps you can do this on your
query and then flush the result to the report. Raise your hand if you need
assitance with this.
HTH, Jens Süßmeyer
--
http://www.sqlserver2005.de
--
"Ross" <synergy56@.hotmail.com> schrieb im Newsbeitrag
news:6sgt515glf8uvkr8vfqqliv554im1l7pak@.4ax.com...
> Hi all
> I'm generating a column chart, lets say its CustomerID as a category
> and SUM(Sales.Value) as a values sorted by SUM(Sales.Value) DESC. That
> might give 100 column bars so we filter the category to show, say, Top
> 20.
> Can anyone see a way, convoluted or otherwise, of creating one more
> column bar to represent SUM(Sales.Value) for the other 80.
> I just want to be sure that I'm not missing something before I dive
> into writing code that creates a temporary table to report on which is
> the only way I can see.
> Cheers
> Ross
>|||Use two queries and union them together. The first query is your top 10.
The second query uses the first query as a subquery to return anly keys,
then do a NOT IN() against the key selection. This will return all but the
top 10 which you can aggregate into a single valued called "Other"
Basing your your chart on the union of these two queries will give you 11
data points; top 10 and other.
Paul Turley
"Ross" <synergy56@.hotmail.com> wrote in message
news:6sgt515glf8uvkr8vfqqliv554im1l7pak@.4ax.com...
> Hi all
> I'm generating a column chart, lets say its CustomerID as a category
> and SUM(Sales.Value) as a values sorted by SUM(Sales.Value) DESC. That
> might give 100 column bars so we filter the category to show, say, Top
> 20.
> Can anyone see a way, convoluted or otherwise, of creating one more
> column bar to represent SUM(Sales.Value) for the other 80.
> I just want to be sure that I'm not missing something before I dive
> into writing code that creates a temporary table to report on which is
> the only way I can see.
> Cheers
> Ross
>|||I did try that, however i'm storing my 'N' for the top N in a parameter, and
i see no way to use a parameter in a query to limit the rows. Likewise i see
no way to add a ranking number in the table itself. anybody?
"Paul Turley" wrote:
> Use two queries and union them together. The first query is your top 10.
> The second query uses the first query as a subquery to return anly keys,
> then do a NOT IN() against the key selection. This will return all but the
> top 10 which you can aggregate into a single valued called "Other"
> Basing your your chart on the union of these two queries will give you 11
> data points; top 10 and other.
> Paul Turley
>
> "Ross" <synergy56@.hotmail.com> wrote in message
> news:6sgt515glf8uvkr8vfqqliv554im1l7pak@.4ax.com...
> > Hi all
> >
> > I'm generating a column chart, lets say its CustomerID as a category
> > and SUM(Sales.Value) as a values sorted by SUM(Sales.Value) DESC. That
> > might give 100 column bars so we filter the category to show, say, Top
> > 20.
> >
> > Can anyone see a way, convoluted or otherwise, of creating one more
> > column bar to represent SUM(Sales.Value) for the other 80.
> >
> > I just want to be sure that I'm not missing something before I dive
> > into writing code that creates a temporary table to report on which is
> > the only way I can see.
> >
> > Cheers
> > Ross
> >
>
>|||You can define a dynamic TopN filter like this:
Filter expression: = Fields!A.Value
Filter operator: TopN
Filter value: = Parameters!Top.Value
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"Ard Goossens" <ArdGoossens@.discussions.microsoft.com> wrote in message
news:CE512986-BE7C-4189-BC4B-70165DE734F2@.microsoft.com...
>I did try that, however i'm storing my 'N' for the top N in a parameter,
>and
> i see no way to use a parameter in a query to limit the rows. Likewise i
> see
> no way to add a ranking number in the table itself. anybody?
>
> "Paul Turley" wrote:
>> Use two queries and union them together. The first query is your top 10.
>> The second query uses the first query as a subquery to return anly keys,
>> then do a NOT IN() against the key selection. This will return all but
>> the
>> top 10 which you can aggregate into a single valued called "Other"
>> Basing your your chart on the union of these two queries will give you 11
>> data points; top 10 and other.
>> Paul Turley
>>
>> "Ross" <synergy56@.hotmail.com> wrote in message
>> news:6sgt515glf8uvkr8vfqqliv554im1l7pak@.4ax.com...
>> > Hi all
>> >
>> > I'm generating a column chart, lets say its CustomerID as a category
>> > and SUM(Sales.Value) as a values sorted by SUM(Sales.Value) DESC. That
>> > might give 100 column bars so we filter the category to show, say, Top
>> > 20.
>> >
>> > Can anyone see a way, convoluted or otherwise, of creating one more
>> > column bar to represent SUM(Sales.Value) for the other 80.
>> >
>> > I just want to be sure that I'm not missing something before I dive
>> > into writing code that creates a temporary table to report on which is
>> > the only way I can see.
>> >
>> > Cheers
>> > Ross
>> >
>>|||Ard,
You can use paramters and variables with the SET ROWCOUNT command. You
could also build a string containing your TOP N query and execute dynamic
SQL, but this is not my preference.
Ted
"Ard Goossens" wrote:
> I did try that, however i'm storing my 'N' for the top N in a parameter, and
> i see no way to use a parameter in a query to limit the rows. Likewise i see
> no way to add a ranking number in the table itself. anybody?
> "Paul Turley" wrote:
> > Use two queries and union them together. The first query is your top 10.
> > The second query uses the first query as a subquery to return anly keys,
> > then do a NOT IN() against the key selection. This will return all but the
> > top 10 which you can aggregate into a single valued called "Other"
> >
> > Basing your your chart on the union of these two queries will give you 11
> > data points; top 10 and other.|||Robert
Do you know by any chance how to handle the cases when Top is null? Let's
say you want to give the users the option to select a Top N value or to leave
it null. Thx
"Robert Bruckner [MSFT]" wrote:
> You can define a dynamic TopN filter like this:
> Filter expression: = Fields!A.Value
> Filter operator: TopN
> Filter value: = Parameters!Top.Value
>
> -- Robert
> This posting is provided "AS IS" with no warranties, and confers no rights.
> "Ard Goossens" <ArdGoossens@.discussions.microsoft.com> wrote in message
> news:CE512986-BE7C-4189-BC4B-70165DE734F2@.microsoft.com...
> >I did try that, however i'm storing my 'N' for the top N in a parameter,
> >and
> > i see no way to use a parameter in a query to limit the rows. Likewise i
> > see
> > no way to add a ranking number in the table itself. anybody?
> >
> >
> >
> > "Paul Turley" wrote:
> >
> >> Use two queries and union them together. The first query is your top 10.
> >> The second query uses the first query as a subquery to return anly keys,
> >> then do a NOT IN() against the key selection. This will return all but
> >> the
> >> top 10 which you can aggregate into a single valued called "Other"
> >>
> >> Basing your your chart on the union of these two queries will give you 11
> >> data points; top 10 and other.
> >>
> >> Paul Turley
> >>
> >>
> >> "Ross" <synergy56@.hotmail.com> wrote in message
> >> news:6sgt515glf8uvkr8vfqqliv554im1l7pak@.4ax.com...
> >> > Hi all
> >> >
> >> > I'm generating a column chart, lets say its CustomerID as a category
> >> > and SUM(Sales.Value) as a values sorted by SUM(Sales.Value) DESC. That
> >> > might give 100 column bars so we filter the category to show, say, Top
> >> > 20.
> >> >
> >> > Can anyone see a way, convoluted or otherwise, of creating one more
> >> > column bar to represent SUM(Sales.Value) for the other 80.
> >> >
> >> > I just want to be sure that I'm not missing something before I dive
> >> > into writing code that creates a temporary table to report on which is
> >> > the only way I can see.
> >> >
> >> > Cheers
> >> > Ross
> >> >
> >>
> >>
> >>
>
>|||There are two different approaches how to deal with this situation:
1. "Fake Parameter" approach:
* Create a "fake" hidden (non-prompted) parameter PSize to calculate the
dataset size. I.e. the parameter default value would be
=CountRows("ChartDataSetName")
* on the chart, the filter expression would look like this:
Filter expression: = Fields!A.Value
Filter operator: TopN
Filter value: = iif( Parameters!Top.Value is Nothing,
Parameters!PSize.Value, Parameters!Top.Value)
2. "Filter with Duplicates" approach:
Filter expression: = iif( Parameters!Top.Value is Nothing, 1,
Fields!A.Value)
Filter operator: TopN
Filter value: = iif( Parameters!Top.Value is Nothing, 1,
Parameters!Top.Value)
Robert M. Bruckner
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Marco" <Marco@.discussions.microsoft.com> wrote in message
news:19869577-684A-4971-A89E-DCA199EC5141@.microsoft.com...
> Robert
> Do you know by any chance how to handle the cases when Top is null? Let's
> say you want to give the users the option to select a Top N value or to
> leave
> it null. Thx
> "Robert Bruckner [MSFT]" wrote:
>> You can define a dynamic TopN filter like this:
>> Filter expression: = Fields!A.Value
>> Filter operator: TopN
>> Filter value: = Parameters!Top.Value
>>
>> -- Robert
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>> "Ard Goossens" <ArdGoossens@.discussions.microsoft.com> wrote in message
>> news:CE512986-BE7C-4189-BC4B-70165DE734F2@.microsoft.com...
>> >I did try that, however i'm storing my 'N' for the top N in a parameter,
>> >and
>> > i see no way to use a parameter in a query to limit the rows. Likewise
>> > i
>> > see
>> > no way to add a ranking number in the table itself. anybody?
>> >
>> >
>> >
>> > "Paul Turley" wrote:
>> >
>> >> Use two queries and union them together. The first query is your top
>> >> 10.
>> >> The second query uses the first query as a subquery to return anly
>> >> keys,
>> >> then do a NOT IN() against the key selection. This will return all but
>> >> the
>> >> top 10 which you can aggregate into a single valued called "Other"
>> >>
>> >> Basing your your chart on the union of these two queries will give you
>> >> 11
>> >> data points; top 10 and other.
>> >>
>> >> Paul Turley
>> >>
>> >>
>> >> "Ross" <synergy56@.hotmail.com> wrote in message
>> >> news:6sgt515glf8uvkr8vfqqliv554im1l7pak@.4ax.com...
>> >> > Hi all
>> >> >
>> >> > I'm generating a column chart, lets say its CustomerID as a category
>> >> > and SUM(Sales.Value) as a values sorted by SUM(Sales.Value) DESC.
>> >> > That
>> >> > might give 100 column bars so we filter the category to show, say,
>> >> > Top
>> >> > 20.
>> >> >
>> >> > Can anyone see a way, convoluted or otherwise, of creating one more
>> >> > column bar to represent SUM(Sales.Value) for the other 80.
>> >> >
>> >> > I just want to be sure that I'm not missing something before I dive
>> >> > into writing code that creates a temporary table to report on which
>> >> > is
>> >> > the only way I can see.
>> >> >
>> >> > Cheers
>> >> > Ross
>> >> >
>> >>
>> >>
>> >>
>>|||Thanks Robert this is very helpful
"Robert Bruckner [MSFT]" wrote:
> There are two different approaches how to deal with this situation:
> 1. "Fake Parameter" approach:
> * Create a "fake" hidden (non-prompted) parameter PSize to calculate the
> dataset size. I.e. the parameter default value would be
> =CountRows("ChartDataSetName")
> * on the chart, the filter expression would look like this:
> Filter expression: = Fields!A.Value
> Filter operator: TopN
> Filter value: = iif( Parameters!Top.Value is Nothing,
> Parameters!PSize.Value, Parameters!Top.Value)
> 2. "Filter with Duplicates" approach:
> Filter expression: = iif( Parameters!Top.Value is Nothing, 1,
> Fields!A.Value)
> Filter operator: TopN
> Filter value: = iif( Parameters!Top.Value is Nothing, 1,
> Parameters!Top.Value)
>
> --
> Robert M. Bruckner
> Microsoft SQL Server Reporting Services
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
> "Marco" <Marco@.discussions.microsoft.com> wrote in message
> news:19869577-684A-4971-A89E-DCA199EC5141@.microsoft.com...
> > Robert
> >
> > Do you know by any chance how to handle the cases when Top is null? Let's
> > say you want to give the users the option to select a Top N value or to
> > leave
> > it null. Thx
> >
> > "Robert Bruckner [MSFT]" wrote:
> >
> >> You can define a dynamic TopN filter like this:
> >> Filter expression: = Fields!A.Value
> >> Filter operator: TopN
> >> Filter value: = Parameters!Top.Value
> >>
> >>
> >> -- Robert
> >> This posting is provided "AS IS" with no warranties, and confers no
> >> rights.
> >>
> >> "Ard Goossens" <ArdGoossens@.discussions.microsoft.com> wrote in message
> >> news:CE512986-BE7C-4189-BC4B-70165DE734F2@.microsoft.com...
> >> >I did try that, however i'm storing my 'N' for the top N in a parameter,
> >> >and
> >> > i see no way to use a parameter in a query to limit the rows. Likewise
> >> > i
> >> > see
> >> > no way to add a ranking number in the table itself. anybody?
> >> >
> >> >
> >> >
> >> > "Paul Turley" wrote:
> >> >
> >> >> Use two queries and union them together. The first query is your top
> >> >> 10.
> >> >> The second query uses the first query as a subquery to return anly
> >> >> keys,
> >> >> then do a NOT IN() against the key selection. This will return all but
> >> >> the
> >> >> top 10 which you can aggregate into a single valued called "Other"
> >> >>
> >> >> Basing your your chart on the union of these two queries will give you
> >> >> 11
> >> >> data points; top 10 and other.
> >> >>
> >> >> Paul Turley
> >> >>
> >> >>
> >> >> "Ross" <synergy56@.hotmail.com> wrote in message
> >> >> news:6sgt515glf8uvkr8vfqqliv554im1l7pak@.4ax.com...
> >> >> > Hi all
> >> >> >
> >> >> > I'm generating a column chart, lets say its CustomerID as a category
> >> >> > and SUM(Sales.Value) as a values sorted by SUM(Sales.Value) DESC.
> >> >> > That
> >> >> > might give 100 column bars so we filter the category to show, say,
> >> >> > Top
> >> >> > 20.
> >> >> >
> >> >> > Can anyone see a way, convoluted or otherwise, of creating one more
> >> >> > column bar to represent SUM(Sales.Value) for the other 80.
> >> >> >
> >> >> > I just want to be sure that I'm not missing something before I dive
> >> >> > into writing code that creates a temporary table to report on which
> >> >> > is
> >> >> > the only way I can see.
> >> >> >
> >> >> > Cheers
> >> >> > Ross
> >> >> >
> >> >>
> >> >>
> >> >>
> >>
> >>
> >>
>
>

Saturday, February 25, 2012

Chart x-axis

I am trying to create a chart using end_date (parameter) as the x-axis. I
have set up the category group expression as "=Month(Fields!End_Date.Value)"
and this is used for my x-axis. When the report is viewed, it shows January -
September, November, December, then October. The end_date is setup as
datetime datatype. The value and the labels are correct, just in the wrong
order. How can I get this x-axis in the correct order?On Aug 14, 9:08 pm, j_rad <j_...@.discussions.microsoft.com> wrote:
> I am trying to create a chart using end_date (parameter) as the x-axis. I
> have set up the category group expression as "=Month(Fields!End_Date.Value)"
> and this is used for my x-axis. When the report is viewed, it shows January -
> September, November, December, then October. The end_date is setup as
> datetime datatype. The value and the labels are correct, just in the wrong
> order. How can I get this x-axis in the correct order?
Hi,
Try to put the sorting expression of the group =Month(Fields!
End_Date.Value)
with ascending order.
V.|||That worked. Thanks for your help.
"Vinnie" wrote:
> On Aug 14, 9:08 pm, j_rad <j_...@.discussions.microsoft.com> wrote:
> > I am trying to create a chart using end_date (parameter) as the x-axis. I
> > have set up the category group expression as "=Month(Fields!End_Date.Value)"
> > and this is used for my x-axis. When the report is viewed, it shows January -
> > September, November, December, then October. The end_date is setup as
> > datetime datatype. The value and the labels are correct, just in the wrong
> > order. How can I get this x-axis in the correct order?
> Hi,
> Try to put the sorting expression of the group =Month(Fields!
> End_Date.Value)
> with ascending order.
> V.
>

Sunday, February 19, 2012

Chart Category Labels

How would I angle my category labels along the x axis of a Stacked Column
Chart. I can set the colors and and styles, but how do I go about making the
label or text sit at a 45 degree angle instead of vertical? Is there an
expression to place on the label property for the categories?This is currently not supported. It is under consideration for inclusion in
a future release.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Clint Jennings" <ClintJennings@.discussions.microsoft.com> wrote in message
news:613CADD4-2F13-469B-A1BA-EE25A02EAB1F@.microsoft.com...
> How would I angle my category labels along the x axis of a Stacked Column
> Chart. I can set the colors and and styles, but how do I go about making
the
> label or text sit at a 45 degree angle instead of vertical? Is there an
> expression to place on the label property for the categories?
>|||Thanks Robert.:)
"Robert Bruckner [MSFT]" wrote:
> This is currently not supported. It is under consideration for inclusion in
> a future release.
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Clint Jennings" <ClintJennings@.discussions.microsoft.com> wrote in message
> news:613CADD4-2F13-469B-A1BA-EE25A02EAB1F@.microsoft.com...
> > How would I angle my category labels along the x axis of a Stacked Column
> > Chart. I can set the colors and and styles, but how do I go about making
> the
> > label or text sit at a 45 degree angle instead of vertical? Is there an
> > expression to place on the label property for the categories?
> >
>
>

chart category field

On the category fields, how is it possible to show the first and the last
values. I.e. the x-axis to show the min value at the start and the max value
at the end.
This is what i have so far but the x-axis displays nothing on the line
=IIf(Min(Fields!Import_Date.Value),Fields!Import_Date.Value,"")This is a work around which I have used in the past but may not be
what you want. You can turn off the axis and create a table item under
your chart to simulate what you are after.
On Nov 20, 11:20 pm, arkiboys2 <arkibo...@.discussions.microsoft.com>
wrote:
> On the category fields, how is it possible to show the first and the last
> values. I.e. the x-axis to show the min value at the start and the max value
> at the end.
> This is what i have so far but the x-axis displays nothing on the line
> =IIf(Min(Fields!Import_Date.Value),Fields!Import_Date.Value,"")|||What is a table item please?
"shaikat.das@.gmail.com" wrote:
> This is a work around which I have used in the past but may not be
> what you want. You can turn off the axis and create a table item under
> your chart to simulate what you are after.
>
> On Nov 20, 11:20 pm, arkiboys2 <arkibo...@.discussions.microsoft.com>
> wrote:
> > On the category fields, how is it possible to show the first and the last
> > values. I.e. the x-axis to show the min value at the start and the max value
> > at the end.
> >
> > This is what i have so far but the x-axis displays nothing on the line
> >
> > =IIf(Min(Fields!Import_Date.Value),Fields!Import_Date.Value,"")
>|||In visual studio , under the toolbox, youll find a table . Drag that
onto the designer, under the x-axis . Make the width of the table same
as the width of your graph and turn off header and footer on the
table. Then create a dataset which has the least and max values which
you want to show on your x axis. Tie this data set to your table and
place the least value in the first cell and the max value in the last
cell. Turn off your x axis and play with the table till you get it to
look like what you need.
Cheers
Shai
On Nov 21, 8:47 pm, arkiboys2 <arkibo...@.discussions.microsoft.com>
wrote:
> What is a table item please?
>
> "shaikat...@.gmail.com" wrote:
> > This is a work around which I have used in the past but may not be
> > what you want. You can turn off the axis and create a table item under
> > your chart to simulate what you are after.
> > On Nov 20, 11:20 pm, arkiboys2 <arkibo...@.discussions.microsoft.com>
> > wrote:
> > > On the category fields, how is it possible to show the first and the last
> > > values. I.e. the x-axis to show the min value at the start and the max value
> > > at the end.
> > > This is what i have so far but the x-axis displays nothing on the line
> > > =IIf(Min(Fields!Import_Date.Value),Fields!Import_Date.Value,"")- Hide quoted text -
> - Show quoted text -