Showing posts with label total. Show all posts
Showing posts with label total. Show all posts

Thursday, March 22, 2012

Bar graphic chart is not in the same order with data table

Hi All,

I have a very simple bar-graphic report that has the following data:

Sale Region Total Sale

A 1,000,000

B 350,000

On the table, the data is sort by the Sale Region, so the A would come before the B. But on the bar-chart, the B is always displayed before the A. If it is a vertical bar chart, and then the B is on the left, the A is on the right. And if it's a hoz. bar chart, the B bar is on the top, and the A bar is on the bottom. I try to modify the RDL to make the bars displayed in order, but failed after many tries.

Here is the RDL code that I wrote in an attempt to make the bars display in ASC order, but does not work:

<CategoryGroupings>

<CategoryGrouping>

<DynamicCategories>

<Sorting>

<SortBy>

<SortExpression>Fields!SaleRegion.Value</SortExpression>

</SortBy>

</Sorting>

<Grouping Name="Chart1CategoryGroup">

<GroupExpressions>

<GroupExpression>=RowNumber(Nothing)</GroupExpression>

</GroupExpressions>

</Grouping>

<Label>=Fields!SaleRegion.Value</Label>

</DynamicCategories>

</CategoryGrouping>

</CategoryGroupings>

Can someone shed a light?

Thanks in advance

You are missing the "=" in the SortExpression. Right now it is just a constant string "Fields!SaleRegionValue".

Change it to:
<SortExpression>=Fields!SaleRegion.Value</SortExpression>

-- Robert

|||

That's it! Thanks Robert. You surely have a pair of hawk's eyes.

I have the chart sorted in order the way I wanted it too. However, I could not get the table order in the same way. I event go into the VS2005 report designer, set the sort property of the table. But no matter what order I set, the table is always displayed in a non-order. I added an ORDER BY clause in the SQL retrieve statement, the table is still displayed in a kind of random order.

Is this a known problem with Reporting Service? Or are there properties that I have to set in order for the table displayed on an ASC or DESC sequence?

Thanks in advance.

|||

It sounds like you have an explicit table detail group or a table group expression defined. In that case, you have to add the sorting directly on the grouping expression.

-- Robert

sql

Bar chart setting

Hi all,

I have the following problem see anyone can help:

I want to show annual total income for each product separately in bar chart. They don't need to show over time, so each product shows only once in the chart. After I drop productName into "series field" side of the bar chart, each bar represent each product with different color but all bars stick together next by next. I would like to separate all bar one by one and remain different color for all bar. How can I do so??Hey, maybe a little late, but hopefully it'll be of use to anyone elselooking for this...try using the products as the category in the chart(you can drop it along the bottom of the chart object).

Bar Chart Question

I am creating a bar chart which contains a category for days of the week and
various values for data. I need to add a total bar that sums values for the
week. Total is not available from the dataset and the category, which is a
field from the dataset doesn't have a value for total either. Has anybody out
there attempted to built something like this?I did a similar thing.
I made it available in the dataset by doing a
union select 'Total', Sum[theData]
This will add total to the column with the single value names which will
have the total value in the value column.
then it will automatically be in your graph.
Hopw that helps, explanation was a bit rubbish
"Johnny C" <JohnnyC@.discussions.microsoft.com> wrote in message
news:8DD592D3-6FD8-4CCB-B9F2-E2918B29C9DA@.microsoft.com...
>I am creating a bar chart which contains a category for days of the week
>and
> various values for data. I need to add a total bar that sums values for
> the
> week. Total is not available from the dataset and the category, which is a
> field from the dataset doesn't have a value for total either. Has anybody
> out
> there attempted to built something like this?

Monday, March 19, 2012

Bad results from my MDX Adventure Works query

I have an Adventure Works MDX query that I want to return all the male employees and their total reseller-sales (including the people below them)

Select [Measures].[Reseller Sales-Sales Amount] on Columns,
non empty
Exists(
[Employee].[Employees].AllMembers
,[Employee].[Gender].&[M]
) on Rows
from [Analysis Services Tutorial]

which, when run, returns

Reseller Sales-Sales Amount
All Employees $80,450,596.98
Ken J. Sánchez $80,450,596.98
Brian S. Welcker $80,450,596.98
Amy E. Alberts $15,535,946.26
Ranjit R. Varkey Chudukatil $4,509,888.93
Stephen Y. Jiang $63,320,315.35
David R. Campbell $3,729,945.35
Garrett R. Vargas $3,609,447.22
Jos Edvaldo. Saraiva $5,926,418.36
Michael G. Blythe $9,293,903.01
Shu K. Ito $6,427,005.56
Stephen Y. Jiang $1,092,123.86
Tete A. Mensa-Annan $2,312,545.69
Tsvi Michael. Reiter $7,171,012.75
Syed E. Abbas $1,594,335.38
Syed E. Abbas $172,524.45

so there are three problems with this result, and I think they all have 1 solution. First, I don't want the 'All Employees' row. Second, there is a female in my results, seemingly because this female is the supervisor of some of the males. I asked for no females in my query. Third, Syed shows up twice, because he is a supervisor and a salesman himself. What I want are these results..


Ken J. Sánchez $80,450,596.98
Brian S. Welcker $80,450,596.98
Ranjit R. Varkey Chudukatil $4,509,888.93
Stephen Y. Jiang $63,320,315.35
David R. Campbell $3,729,945.35
Garrett R. Vargas $3,609,447.22
Jos Edvaldo. Saraiva $5,926,418.36
Michael G. Blythe $9,293,903.01
Shu K. Ito $6,427,005.56
Stephen Y. Jiang $1,092,123.86
Tete A. Mensa-Annan $2,312,545.69
Tsvi Michael. Reiter $7,171,012.75
Syed E. Abbas $1,594,335.38

Notice that there are no "All Employees", the woman is gone, and Syed is only a supervisor, and not an underling also. What MDX query would give me these results?

Thanks,

Todd Wilder

Referring to my response to your earlier post, this query seems to return the results you want - except for the order:

Select [Measures].[Reseller Sales Amount] on Columns,
non empty Generate(exists([Employee].[Employee].[Employee],
[Employee].[Gender].&[M]),
{LinkMember([Employee].[Employee].CurrentMember,
[Employee].[Employees])}) on Rows
from [Adventure Works]

|||Your queries dont seem to return anything on my cubes - your measure is named slightly different then mine and I don't have any tuples like [Employee].[Employee].[Employee]. Where did your cube come from?|||

Are you aware of the Adventure Works standard sample cube?

http://msdn2.microsoft.com/en-us/library/ms143804.aspx

>>

SQL Server 2005 Books Online

Running Setup to Install AdventureWorks Sample Databases and Samples

Updated: 17 July 2006

The AdventureWorks (OLTP), AdventureWorksDW (data warehouse), and Adventure Works DW (analysis services) sample databases, as well as the companion samples, are not installed by default in SQL Server 2005. You can download these from SQL Server 2005 Samples and Sample Databases at the Microsoft Download Center, or you can use the following procedures to install the sample databases and samples during or after setup. Additional instructions for deploying the Adventure Works DW analysis services project are also provided.

...

>>