Problem With Simple Grouping Subtotal
May 13, 2008
In SRS2000, I have a simple grouping matrix report setup like the following:
Code Snippet
=Fields!Date.Value Total
=Fields!Section.Value =Fields!Count.Value
Total
It's essentially a table of departmental statistics that would report like this:
Code Snippet
5/1/08 5/2/08 5/3/08 5/4/08 Total
Dept1 0 99 33 4 XX
Dept2 1 0 2 1 XX
Total XX XX XX XX XX
The report has 2 groups - 1 for the dates and 1 for the departments.
The report data itself displays correctly. My problem comes in when I try to add the Subtotals.
I simply right-click on each of the two Groups and chose "Subtotal". This action inserts the Total column & row respectively and you would think everything is just fine.
Unfortunately when I actually run the report, I see that the Totals it's coming up with are incorrect. In fact, they are the totals of the FIRST row/column only.
Meaning - (using the previous example) - I'd see this:
Code Snippet
5/1/08 5/2/08 5/3/08 5/4/08 Total
Dept1 0 99 33 4 0
Dept2 1 0 2 1 1
Total 0 99 33 4 0
It's like it's not taking anything into account except the first instance.
And it's not like you can actually *see* the expression or formula being used for the Total function. The data cells are just grayed.. all you can really change is the "Total" text.
I must be doing something really stupid here, but for the life of me I don't see what it is.
Any ideas?
Thanks!
View 1 Replies
ADVERTISEMENT
Apr 23, 2008
I have matrix with 3 row groupings
Parent, Child, Baby
I have a value in the data cell and also a dummy column grouping to show some % values.
The % is basically what the row subtotal represents as a % of all the data in the dataset.
The Parent row group also has a subtotal, so the % here will show all values within the parent as a % of all data.
I have interactive sorting on Parent, Child and Baby.
but what I want to do is this:
Interactive sorting of the parent-subtotal-percent column values to cause a physical reordering of the parents.
i.e. show me the parents in order of their "% as a total of the entire dataset"
Possible?
View 5 Replies
View Related
Jun 15, 2015
How do you incorporate a case statement so that you can add "sub total" and grand total" to each grouping set section? Trying to see how to incorporate case.
[URL] ....
SELECT
CustomerID,
SalesPersonID,
YEAR(OrderDate) AS 'OrderYear',
SUM(TotalDue) AS 'TotalDue'
FROM Sales.SalesOrderHeader
[Code] .....
View 4 Replies
View Related
Jun 5, 2008
I'm sure this is very basic, I'll try not to be too embarrassed asking it.
Given a table called MainTable, and a second table called Details, with a one-to-many relationship between them, which is the better practice in regards to getting a number of values from each MainTable record plus an aggregate of a value from the related Details records...?
--=====================================
--Method 1
--Group by every selected field in MainTable
SELECT MainTable.Rec_Num,
MainTable.Name,
MainTable.Description,
SUM(Details.Amount) AS Amount
FROM MainTable
INNER JOIN Details
ON MainTable.Rec_Num = Details.MainTable_Rec_Num
GROUP BY MainTable.Rec_Num, MainTable.Name, MainTable.Description
--Method 2
--Group by PK record in MainTable and aggregate the others
SELECT MainTable.Rec_Num,
MAX(MainTable.Name) AS [Name],
MAX(MainTable.Description) AS [Description],
SUM(Details.Amount) AS [Amount]
FROM MainTable
INNER JOIN Details
ON MainTable.Rec_Num = Details.MainTable_Rec_Num
GROUP BY MainTable.Rec_Num
--=====================================
Or perhaps there's another option I'm not aware of?
Thanks!
Ron Moses
ConEst Software Systems
View 4 Replies
View Related
Jul 30, 2007
Hello,
I have a table similar to the following (XYZ). I would like to write a select statement that will return the count of the unique items for each user that also happen to be less than 1 year old. The less than one year old part is rather easy dateadd(year, -1, getdate()), but I seem to be having a hard time figuring out how to get my desired result without using subselects. Any help greatly appreciated. Thanks in advance - Dan.
So my goal results are:
User Count
Dan 2
Dave 1
Table XYZ
ID User Item Value Date
1 Dan 1 20 5/5/2007
2 Dan 1 30 6/5/2007
3 Dave 2 25 6/1/2007
4 Dan 2 22 5/1/2007
5 Dan 3 23 5/1/2006
View 6 Replies
View Related
Apr 1, 2008
My report has two groups, company and error type for each company.
Company1
Functional Error
Data Error
Other Error
My goal is to show the subtotals for each error types when I show Company's subtotal/total; in the group 1 footer area.
Total for Functional Error:
Total for Data Error:
Total for Company1:
Please help me in figuring out how to do that.
Thank you in advance for your help.
View 3 Replies
View Related
Nov 26, 2007
I'm really stumped on this one. I'm a self taught SQL guy, so there is probobly something I'm overlooking.
I'm trying to get information like this in to a report:
WO#
-WO Line #
--(Details)
--Work Order Line Detail #1
--Work Order Line Detail #2
--Work Order Line Detail #3
--Work Order Line Detail #etc
--(Parts)
--Work Order Line Parts #1
--Work Order Line Parts #2
--Work Order Line Detail #etc
WO#
-WO Line #
--(Details)
--Work Order Line Detail #1
--Work Order Line Detail #2
--Work Order Line Detail #3
--Work Order Line Detail #etc
--(Parts)
--Work Order Line Parts #1
--Work Order Line Parts #2
--Work Order Line Parts #etc
I'm unable to get the grouping right on this. Since the line details and line parts both are children of the line #, how do you do "parallel groups"?
There are 4 tables:
Work Order Header
Work Order Line
Work Order Line Details
Work Order Line Requisitions
The Header has a unique PK.
The Line uses the Header and a Line # as foreign keys that together are unique.
The Detail and requisition tables use the header and line #'s in addition to their own line number foreign keys. My queries ends up looking like this:
WO WOL WOLR WOLD
226952 10000 10000 10000
226952 10000 10000 20000
226952 10000 10000 30000
226952 10000 10000 40000
226952 10000 20000 10000
226952 10000 20000 20000
226952 10000 20000 30000
226952 10000 20000 40000
399999 10000 NULL 10000
375654 10000 10000 NULL
etc
Hierarchy:
WO > WOL > WOLD
WO > WOL > WOLR
It probobly isn't best practice, but I'm kinda new so I need some guidance. I'd really appreciate any help! Here's my query:
SELECT [Work Order Header].No_ AS WO_No, [Work Order Line].[Line No_] AS WOL_No,
[Work Order Requisition].[Line No_] AS WOLR_No, [Work Order Line Detail].[Line No_] AS WOLD_No
FROM [Work Order Header] LEFT OUTER JOIN
[Work Order Line] ON [Work Order Header].No_ = [Work Order Line].[Work Order No_] LEFT OUTER JOIN
[Work Order Line Detail] ON [Work Order Line].[Work Order No_] = [Work Order Line Detail].[Work Order No_] AND
[Work Order Line].[Line No_] = [Work Order Line Detail].[Work Order Line No_] LEFT OUTER JOIN
[Work Order Requisition] ON [Work Order Line].[Work Order No_] = [Work Order Requisition].[Work Order No_] AND
[Work Order Line].[Line No_] = [Work Order Requisition].[Work Order Line No_]
View 1 Replies
View Related
May 26, 2004
Hey,
I have MS SQL database.
I have procedure:
code:--------------------------------------------------------------------------------
CREATE PROCEDURE dbo.Reg_DropTable
@ModuleId varchar(10)
AS
declare @TableName varchar, @kiek numeric
set @TableName = 'reg_'+@ModuleId
begin
DROP TABLE @TableName <- HERE I GOT ERROR
end
GO
--------------------------------------------------------------------------------
I got error when using variable with tables names.
How to do this?
Ps. Number is send to this function and it must drop table with name Reg_[That number]
View 1 Replies
View Related
Apr 25, 2008
How can something like this be done in reporting services? I'm having trouble to get the totals, because if I do Sum(Fields!Yes.Value) + Sum(Fields!No.Value) it will just give me the overall total (133).
Please help guys. I tried with the matrix but it always breaks or just doesn't want to give me the subtotals.
Description
Yes
No
Subtotal
Studies
50
22
72
Works
28
33
61
€¦
€¦
€¦
€¦
View 1 Replies
View Related
Nov 7, 2007
I want to create a subtotal for my results in my table, for example:
=Fields!Animals.Value =Fields!Result.Value
Dogs 3
Cats 4
bird 6
SubTotal 13
If i use =Sum(Fields!Result.Value) i have a error #Error, i don't know how do ir, Someone can help me?
Thank you a lot!
View 12 Replies
View Related
May 28, 2008
Hello,
I have a matrix with subtotal.
I want to hide or show the subtotal by a parameter.
The header of the subtotal is not a problem since it have the "visibility" property.
The problem is that when I'm clicking on the green rectangle to go to the subtotal area itself - It doesn't have the "visibility" property.
So I don't see the header but I see the subtotal date itself.
Any idea on how to resolve this?
Thanks.
View 7 Replies
View Related
Jun 9, 2006
I need to total filtered values each time the filter criteria changes.
So lets say I change the month to JAN then in addition to the subtotals for each category I need to get a Grand Total.
Thanks much.
SELECT Location, SUM(month_est) AS SubTot_Month_Est, SUM(actual) AS SubTot_Actual, mnth, yr
FROM dbo.meetings
GROUP BY Location, mnth, yr
View 3 Replies
View Related
Jul 20, 2005
Hi,WITH SQL SERVER QUETY, I have output likePRJ item qty=================P1 I1 10P1 I1 20P1 I2 10P2 I2 10P2 I3 10================I WANT TO MANIPULATE IT LIKE THISPRJ item qty=================P1 I1 30P1 I2 10---------------P1 * 40---------------P2 I2 10P2 I3 10---------------P2 * 20---------------===============PRJ * 60===============SHOW DATA AND SUBTOTAL AND GRAND TOTAL IN ONE RESULTSETCAN ANYBODY HELPTHANKS IN ADV.T.S.NEGI
View 2 Replies
View Related
Jul 17, 2007
hi,
i am using SQL server reporting services 2000. in that i am using a matrix and one column group and a one row group. i want to calculate total of row and column group and i insert a subtotal at for row and column group.
butits calculation wrong total just picking first row and first column in total.
Application
ABC
DEF
123
456
Total
stat
17
15
3
6
17
Config
15
0
12
0
15
CSP - IMS
11
10
0
0
11
Portalm
10
8
8
0
10
Total
17
15
3
6
17
can anyone help me in this regards.
Regards,
Faisal Saleem
View 5 Replies
View Related
Mar 13, 2007
Hi
I have the following matrix
CA AZ
No surplus 11 5
Surplus 12 10
Zotal 100 50
Totlal 123 65
I want that only (No surplus and Surplus) sum include in total Can I apply This condition on Subtotal.
thanks in advance
View 1 Replies
View Related
Jul 23, 2007
Hi Everyone,
I am trying to get something like this using matrix in reporting services
SE
CP
CG
Total
Qty
Value
Qty
Value
Qty
Value
Qty
Value
GST
Net
7/07/2006
124
233
552
525
141
2544
563
4215
321
4536
8/07/2006
1245
211
11
142
555
1444
1987
1854
124
1978
The problem is, in the total group, the GST value and Net ( Net = Value + GST) can't added into the total group in the matrix.
Can somebody help... Thanks a lot.
View 2 Replies
View Related
Dec 7, 2007
Is there a way to make the subtotal column appear on every page when the matrix spans multiple pages?
View 1 Replies
View Related
Nov 10, 2005
I'm still new to reporting services so forgive me for the newbie question...
View 9 Replies
View Related
Jun 21, 2006
Hello,
I want to have a subtotal column AND a subaverage column (or n total columns) like the one in the following example - but without the extra Avg column in the Data area.
How to do that?
2000
Q. 2
April
Avg
May
Avg
June
Avg
Total
Avg
North
4800
4800
5708
5708
5580
5580
16088
5363
South
3238
3238
3637
3637
3527
3527
10402
3467
West
1699
1699
1687
1687
1614
1614
5000
1667
Thank you!
View 10 Replies
View Related
Apr 21, 2008
i would like to return total value for each row and column.
can someone send a sample code?
like:
columnA columnB Total
4 5 9
5 1 6
3 2 5
12 8 20
View 3 Replies
View Related
Oct 23, 2007
I have a problem about my subtotal.I cannot change the background color based on my conditions.But what makes me think is that the font of my subtotal changes, the same as when my cell data meets my condition,without changing the subtotal's property.
What could be the reason why my subtotal wont change?I have a condition in my background
=iif(Fields!IsHold.Value = True,"Red","White")
View 2 Replies
View Related
Jan 21, 2008
Hello,
I have created a report - matrix from column month, day, week, partnergroup, number.
With subtotals per each criteria.
Current report:
month week day partnergroup sum
1 1 2008-01-01 loans 10
1 1 2008-01-01 mortgages 20
total day 30
....
1 1 2008-01-02 loans 40
1 1 2008-01-02 mortgages 0
total day 40
...
... total week 200
I need subtotals for week with rows for each partnergroup. It should be like this:
month week day partnergroup sum
1 1 2008-01-01 loans 10
1 1 2008-01-01 mortgages 20
total day 30
....
1 1 2008-01-02 loans 40
1 1 2008-01-02 mortgages 0
total day 40
...
... total week loans 110
mortgages 90
Could anybody help me ?
View 8 Replies
View Related
Jul 23, 2007
Hopefully this is a simple question. We have a report with several subreports that display certain totals by a group. What we want to do now it to show a running total on the main report. Is there a way to pass data from the subreport (the subtotal) to the main report for a Grand Total?
Thanks for any information.
View 3 Replies
View Related
Oct 25, 2007
Hi,
I am using a matrix to report, and there is 2 rowgroups and onde column group. It looks like this:
T1 T2 T3 T4
type1 A 9 3 2 4
B 6
type2 A 1 2 3
B 2 4 1 7
But I need to sum only 2 columns of the report (columns T2 and T3):
T1 T2 T3 T4 T2+T3
type1 A 9 3 2 4 5
B 6 6
C
type2 A 1 2 3 2
B 2 4 1 7 5
C 8
And I do not know how to create this sum column, only the default sobtotal column of a matrix.
I tried to do this sum in my datasource, but with no success too.
I also tried to use a table, but the columns must be create automatically from database data and I couldn't do it.
Another issue is: how to make line C appear even with only null or zero numbers?
Any ideas?
I am new with reporting services, so please be clear and detailed.
Thanks a lot!
View 1 Replies
View Related
Sep 21, 2006
Hi All,
I wish to have a report with 2 subtotal using matrix control given by reporting service.
CD
DVD
Total Price
Total Qty
2.00
5.00
JOHN
5
25.00
5
JOLIN
5
10.00
5
Total Price
10.00
25.00
Total Qty
5
5
I only can came out total price(subtotal) which provided by matrix control.
Does the matrix control able to come out as table above with 2 subtotal?
Thanks
Kendy
View 7 Replies
View Related
Apr 16, 2008
Hello everybody,
I would like to put a subtotal at the top of the report, before the data row. Is it possible, and how to do that ?
Thank you in advance for your precious help.
Regards,
Yen
View 4 Replies
View Related
Jul 4, 2007
i hv finished a report and it looks like the follow:
Status Service A Net in service
Install Disconnect
Completed 100 10 90
Canceled 5 2 3
outstanding 20 5 15
However, actually I just want to display 'Net in service' for 'Completed' status only, like below:
Status Service A Net in service
Install Disconnect
Completed 100 10 90
Canceled 5 2 -
outstanding 20 5 -
Is there anyway to do so? Thank you so much for your help!
View 3 Replies
View Related
May 16, 2007
In a group footer in a table, I am trying to calculate a particular field. On the first report I have the following:
=Sum(IIf(Fields!annualAmt.Value = 0,0,Fields!amtYTD.Value/Fields!annualAmt.Value))
I do get a warning, about attempting to divide by zero, which is sometimes the case, but when I deploy this report, it looks fine, it is formatted as a percentage and the divide by zero cases show up as 0%, just as I want it.
However, in a similar, second report, I used the same code as above, and I get the same warning as above, but when I deploy I get the dreaded '#error' for every single case.
I cannot work out what is different between the two and why one would work and the other not work...
Is is something really simple that I have overlooked? Anyone got any ideas?
Thanks in advance!
View 6 Replies
View Related
Oct 23, 2007
I have a big problem, i need to put my subtotal in right: Tabela aninhada, célula 1Tabela aninhada, célula 2 Tabela unida, célula 3 Column value Column value Row valueDataSubTotal by Row
I want my Matrix showning my SubTotal how this:
Column value
Row value
Data
SubTotal Row
SubTotal Column
My Matriz is how this below: And I don't want it.
Column Value
SubTotal Column
Row Value
SubTotal
Data
Thank you a lot!
View 1 Replies
View Related
Jul 4, 2006
Dear guru!
How I can define subtotal by page in the table? Is it possible?
Thanks in advanced.
View 6 Replies
View Related
Jun 3, 2007
Hello,
Can I hardcode matrix subtotal?
For instance, I want to hardcode "100%" in the following Sales report:
2007 Year
Quantity
Phones 21%
Notebooks 30%
Total 100%
Please don't ask me why I need to do that, it's a complex MDX query and the report is much more complex than I depicted.
I just need to statically write 100% in subtotal.
View 4 Replies
View Related