Revert Matrix table
Hi All,
Some genius is causing me a major headache!
They create a table like the following:
part_number varchar2(50),
year varchar2(4),
jan_amount number,
feb_amount number,
mar_amount number,
apr_amount number,
may_amount number,
jun_amount number,
jul_amount number,
aug_amount number,
sep_amount number,
oct_amount number,
nov_amount number,
dec_amount number
This makes it extremely hard to report on
I would like to create a table like the following
part_number varchar2(50),
year varchar2(4),
month varchar2(3).
amount number
I am not sure how to write a query to transform the data for the matrix table into my new table. Could someone help with this? I would like to enter all the months for a year into the new table even if some of the month for that year are null. I will need to run this nightly......
Thanks so much !!
Hi,
832305 wrote:
Hi All,
Some genius is causing me a major headache!
They create a table like the following:
part_number varchar2(50),
year varchar2(4),
jan_amount number,
feb_amount number,
mar_amount number,
apr_amount number,
may_amount number,
jun_amount number,
jul_amount number,
aug_amount number,
sep_amount number,
oct_amount number,
nov_amount number,
dec_amount number
This makes it extremely hard to report on
I would like to create a table like the following
part_number varchar2(50),
year varchar2(4),
month varchar2(3).
amount number
I am not sure how to write a query to transform the data for the matrix table into my new table. Could someone help with this? I would like to enter all the months for a year into the new table even if some of the month for that year are null. I will need to run this nightly......
Thanks so much !!You're right; that's not a very good design.
Here's one way you can create a view like you requested:
CREATE OR REPLACE VIEW normalized_x AS
WITH all_months AS
SELECT TO_CHAR ( ADD_MONTHS ( SYSDATE
, LEVEL
, 'MON'
, 'NLS_DATE_LANGUAGE=ENGLISH' -- If necessary
) AS month_abbr
FROM dual
CONNECT BY LEVEL <= 12
SELECT x.part_number
, x.year
, m.month_abbr
, NVL ( CASE m.month_abbr
WHEN 'JAN' THEN x.jan_amount
WHEN 'FEB' THEN x.feb_amount
WHEN 'DEC' THEN x.dec_amount
END
, 0
) AS amount
FROM table_x x
CROSS JOIN all_months m
;If you don't want a view, the same technique will work in a CREATE TABLE AS statement, or an INSERT, or a plain query.
This will produce 12 rows of output for each row in the table, regardless of whether any (or all) of the 12 amount columns were NULL in the original table.
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables, and also post the results you want from that data.
If you're asking about a DML statement, such as INSERT, the sample data will be the contents of the table(s) before the DML, and the results will be state of the changed table(s) when everything is finished.
Explain, using specific examples, how you get those results from that data.
Always say which version of Oracle you're using. The statement above will work in Oracle 9.1 and higher. Starting in Oracle 11.1, you could also use SELECT ... UNPIVOT, but I'm not sure that would be any more efficient or otherwise better in this case. ( Unpivot is the generic term for taking multiple columns on one row, and displaying them as one column on multiple rows.)
Similar Messages
-
Matrix table add year over year variance
I am trying to get add a variance column to a matrix report is ssrs 2008 r2. However I am unable to create the custom code needed. I have been working with many examples online but none seem to fit what I am trying to do. Any help would be great. I am trying
to calculate the diff at a month level year over year. Like month 1 2013 – month 1 2014
I have a matrix table with three column grouping
Quarter
Month
Year
Design view of table
Quarter
Month
Year
Customer
Job Location
Job id
Example of what I need (Variance)
1
1
variance
1
1
variance
1
1
2
2
2013
2014
2013
2014
Acme
Acme Philadelphia
jj123
100
150
50
150
100
-50
Dataset
select
Fisc_year
,(case
when
datepart(month,dt)
= 11 then 1
when
datepart(month,dt)
= 12 then 2
when
datepart(month,dt)
= 1 then 3
when
datepart(month,dt)
= 2 then 4
when
datepart(month,dt)
= 3 then 5
when
datepart(month,dt)
= 4 then 6
when
datepart(month,dt)
= 5 then 7
when
datepart(month,dt)
= 6 then 8
when
datepart(month,dt)
= 7 then 9
when
datepart(month,dt)
= 8 then 10
when
datepart(month,dt)
= 9 then 11
when
datepart(month,dt)
= 10 then 12
end)
as Mnth
,fisc_qrtr
as Qrt
,Customer_Name
,Job_Name
,sum(REVENUE)
as REVENUE
from tbl_whatever
where Customer_name
= @Customername
and Fisc_year
= @FyearHi SQLtl,
To achieve your requirement, we can directly use expression. For more details, please refer to the following steps:
Right-click the column contains Year field to insert a column with Outside Group-Right.
Then type the following expression to the corresponding cells:
=Sum(iif(Fields!Year.Value="2014",Fields!REVENUE.value,0))-Sum(iif(Fields!Year.Value="2013",Fields!REVENUE.value,0))
Besides, we can also use custom code to achieve the same goal, please see:
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/5f44a0b5-144b-4e6e-b81e-d9b025427748/how-to-get-the-difference-between-two-columns-in-a-column-group?forum=sqlreportingservices
If there are any other questions, please feel free to ask.
Thanks,
Katherine Xiong
If you have any feedback on our support, please click
here.
Katherine Xiong
TechNet Community Support -
Dynamically assigning aggregation type in a matrix table
I have a matrix table that will produce multiple summary columns. These columns should not all use Sum in the Totals row at the bottom. Some will any of these to be determined at runtime: Sum, Avg, Count, Min, Max. I have a column in the
underlying dataset that will tell me which aggregation type to use and now I need some logic in the summary cell to use the correct aggregation type. I tried different variation of this:
=IIF(Fields!AgType = "Sum", Sum(Fields!VI_Impact.Value), … next IIF statement….
And here’s the full line
=IIF(Fields!AgType = "Sum", Sum(Fields!VI_Impact.Value), IIF(Fields!AgType = "Avg", Avg(Fields!VI_Impact.Value), IIF(Fields!AgType = "Cnt", Count(Fields!VI_Impact.Value), IIF(Fields!AgType
= "Min", Min(Fields!VI_Impact.Value), IIF(Fields!AgType = "Max", Max(Fields!VI_Impact.Value), 0)))))
I also replaced the zero at the end with another sum statement as a default if nothing else is used.
Just to keep it real simple for proof of concept, I used:
=IIF(Fields!AgType = "Sum", Sum(Fields!VI_Impact.Value), Sum(Fields!VI_Impact.Value))
But the report gets the error:
The Value expression for the textrun ‘VI_Impact.Paragraphs[0].TextRuns[0]’ contains an error: [BC30311] Value of type ‘Microsoft.ReportingServies.ReportProcessing.ReportObjectModel.field’ Cannot be converted to ‘String’
Any idea how I can make this work?Thanks Jason. I've put an sql script below that will create a test table and populate it with test data. I also attached an rdl file so after you run the script and load the report, all you need to do is update the report's data source
to the correct database and you will see exactly what I'm trying to do.
This report table creates a maxtrix with 4 SUM columns to the right. as you will see in the data, the column headers are named by "VA", and column "AgType" shows how the column should be aggregated. Once you run the report
and look at the data it should be easy to understand.
Thanks for any help you can offer.
DESCRIPTION: Schema Synchronization Script for Object(s) \r\n
tables:
[dbo].[zzzRptValueImpactListing]
AUTHOR: [Insert Author Name]
DATE: 11/19/2014 5:17:57 PM
LEGAL: 2013[Insert Company Name]
SET NOEXEC OFF
SET ANSI_WARNINGS ON
SET XACT_ABORT ON
SET IMPLICIT_TRANSACTIONS OFF
SET ARITHABORT ON
SET NOCOUNT ON
SET QUOTED_IDENTIFIER ON
SET NUMERIC_ROUNDABORT OFF
SET CONCAT_NULL_YIELDS_NULL ON
SET ANSI_NULLS ON
SET ANSI_PADDING ON
GO
USE [VME_KP]
GO
BEGIN TRAN
GO
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN IF @@TRANCOUNT>0 ROLLBACK SET NOEXEC ON END
GO
-- Create Table [dbo].[zzzRptValueImpactListing]
Print 'Create Table [dbo].[zzzRptValueImpactListing]'
GO
CREATE TABLE [dbo].[zzzRptValueImpactListing] (
[Id_Number] [int] NULL,
[Id_Name] [nvarchar](4000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[VA] [nvarchar](10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[VI_Impact] [decimal](18, 3) NULL,
[Id_Assignees] [nvarchar](500) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[AgType] [nvarchar](10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Pj_Id] [uniqueidentifier] NOT NULL
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN IF @@TRANCOUNT>0 ROLLBACK SET NOEXEC ON END
GO
ALTER TABLE [dbo].[zzzRptValueImpactListing] SET (LOCK_ESCALATION = TABLE)
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN IF @@TRANCOUNT>0 ROLLBACK SET NOEXEC ON END
GO
IF @@TRANCOUNT>0
COMMIT
SET NOEXEC OFF
DESCRIPTION: Synchronization Script for Object(s)
Tables:
[dbo].[zzzRptValueImpactListing]
AUTHOR: [Insert author name]
DATE: 11/19/2014 5:50:25 PM
LEGAL: 2014 [Insert company name]
SET NOEXEC OFF
SET ANSI_WARNINGS ON
SET XACT_ABORT ON
SET IMPLICIT_TRANSACTIONS OFF
SET ARITHABORT ON
SET NOCOUNT ON
SET QUOTED_IDENTIFIER ON
SET NUMERIC_ROUNDABORT OFF
SET CONCAT_NULL_YIELDS_NULL ON
SET ANSI_NULLS ON
SET ANSI_PADDING ON
GO
BEGIN TRAN
-- =======================================================
-- Synchronization Script for Table: [dbo].[zzzRptValueImpactListing]
-- =======================================================
Print 'Synchronization Script for Table: [dbo].[zzzRptValueImpactListing]'
INSERT INTO [dbo].[zzzRptValueImpactListing] ([Id_Number], [Id_Name], [VA], [VI_Impact], [Id_Assignees], [AgType], [Pj_Id]) VALUES (5, N'Change from double tape to liquid glue', N'Prod Cost', CONVERT([decimal](18, 3),-0.050), N'Philipp Bart
Steve Stewart', N'Sum', '47c9efba-f25e-4ffe-be66-5c5e7f3a3e18')
INSERT INTO [dbo].[zzzRptValueImpactListing] ([Id_Number], [Id_Name], [VA], [VI_Impact], [Id_Assignees], [AgType], [Pj_Id]) VALUES (7, N'Position of NTC out of contact area', N'Complexity', CONVERT([decimal](18, 3),-170.000), NULL, N'Sum', '47c9efba-f25e-4ffe-be66-5c5e7f3a3e18')
INSERT INTO [dbo].[zzzRptValueImpactListing] ([Id_Number], [Id_Name], [VA], [VI_Impact], [Id_Assignees], [AgType], [Pj_Id]) VALUES (7, N'Position of NTC out of contact area', N'Mrk Conf', CONVERT([decimal](18, 3),8.000), NULL, N'Avg', '47c9efba-f25e-4ffe-be66-5c5e7f3a3e18')
INSERT INTO [dbo].[zzzRptValueImpactListing] ([Id_Number], [Id_Name], [VA], [VI_Impact], [Id_Assignees], [AgType], [Pj_Id]) VALUES (8, N'Change type of patches', N'Mrk Conf', CONVERT([decimal](18, 3),7.000), NULL, N'Avg', '47c9efba-f25e-4ffe-be66-5c5e7f3a3e18')
INSERT INTO [dbo].[zzzRptValueImpactListing] ([Id_Number], [Id_Name], [VA], [VI_Impact], [Id_Assignees], [AgType], [Pj_Id]) VALUES (9, N'Reduce winding turns for harness', N'Mrk Conf', CONVERT([decimal](18, 3),8.000), NULL, N'Avg', '47c9efba-f25e-4ffe-be66-5c5e7f3a3e18')
INSERT INTO [dbo].[zzzRptValueImpactListing] ([Id_Number], [Id_Name], [VA], [VI_Impact], [Id_Assignees], [AgType], [Pj_Id]) VALUES (9, N'Reduce winding turns for harness', N'Relblty', CONVERT([decimal](18, 3),1.500), NULL, N'Sum', '47c9efba-f25e-4ffe-be66-5c5e7f3a3e18')
INSERT INTO [dbo].[zzzRptValueImpactListing] ([Id_Number], [Id_Name], [VA], [VI_Impact], [Id_Assignees], [AgType], [Pj_Id]) VALUES (11, N'Use fix sizes of carrier material rolls', N'Prod Cost', CONVERT([decimal](18, 3),-0.310), N'Marc Pauwels', N'Sum', '47c9efba-f25e-4ffe-be66-5c5e7f3a3e18')
INSERT INTO [dbo].[zzzRptValueImpactListing] ([Id_Number], [Id_Name], [VA], [VI_Impact], [Id_Assignees], [AgType], [Pj_Id]) VALUES (11, N'Use fix sizes of carrier material rolls', N'Prod Cost', CONVERT([decimal](18, 3),-0.310), N'Marc Pauwels', N'Sum', '47c9efba-f25e-4ffe-be66-5c5e7f3a3e18')
INSERT INTO [dbo].[zzzRptValueImpactListing] ([Id_Number], [Id_Name], [VA], [VI_Impact], [Id_Assignees], [AgType], [Pj_Id]) VALUES (12, N'Cold pressing process for laying or needle technology', N'Prod Cost', CONVERT([decimal](18, 3),0.080), N'George Padvorac', N'Sum', '47c9efba-f25e-4ffe-be66-5c5e7f3a3e18')
INSERT INTO [dbo].[zzzRptValueImpactListing] ([Id_Number], [Id_Name], [VA], [VI_Impact], [Id_Assignees], [AgType], [Pj_Id]) VALUES (12, N'Cold pressing process for laying or needle technology', N'Relblty', CONVERT([decimal](18, 3),0.500), N'George Padvorac', N'Sum', '47c9efba-f25e-4ffe-be66-5c5e7f3a3e18')
INSERT INTO [dbo].[zzzRptValueImpactListing] ([Id_Number], [Id_Name], [VA], [VI_Impact], [Id_Assignees], [AgType], [Pj_Id]) VALUES (13, N'Liquid cold gluing instead of hot processing', N'Complexity', CONVERT([decimal](18, 3),-100.000), N'Philipp Blattert', N'Sum', '47c9efba-f25e-4ffe-be66-5c5e7f3a3e18')
INSERT INTO [dbo].[zzzRptValueImpactListing] ([Id_Number], [Id_Name], [VA], [VI_Impact], [Id_Assignees], [AgType], [Pj_Id]) VALUES (13, N'Liquid cold gluing instead of hot processing', N'Mrk Conf', CONVERT([decimal](18, 3),8.000), N'Philipp Blattert', N'Avg', '47c9efba-f25e-4ffe-be66-5c5e7f3a3e18')
INSERT INTO [dbo].[zzzRptValueImpactListing] ([Id_Number], [Id_Name], [VA], [VI_Impact], [Id_Assignees], [AgType], [Pj_Id]) VALUES (14, N'Confidential', N'Prod Cost', CONVERT([decimal](18, 3),-0.020), NULL, N'Sum', '47c9efba-f25e-4ffe-be66-5c5e7f3a3e18')
INSERT INTO [dbo].[zzzRptValueImpactListing] ([Id_Number], [Id_Name], [VA], [VI_Impact], [Id_Assignees], [AgType], [Pj_Id]) VALUES (16, N'Decrease positioning tolerances to reduce distance between parts', N'Complexity', CONVERT([decimal](18, 3),-40.000), NULL, N'Sum', '47c9efba-f25e-4ffe-be66-5c5e7f3a3e18')
INSERT INTO [dbo].[zzzRptValueImpactListing] ([Id_Number], [Id_Name], [VA], [VI_Impact], [Id_Assignees], [AgType], [Pj_Id]) VALUES (16, N'Decrease positioning tolerances to reduce distance between parts', N'Prod Cost', CONVERT([decimal](18, 3),-0.060), NULL, N'Sum', '47c9efba-f25e-4ffe-be66-5c5e7f3a3e18')
INSERT INTO [dbo].[zzzRptValueImpactListing] ([Id_Number], [Id_Name], [VA], [VI_Impact], [Id_Assignees], [AgType], [Pj_Id]) VALUES (17, N'Control and reduce amount of thermoactive glue', N'Prod Cost', CONVERT([decimal](18, 3),-0.030), NULL, N'Sum', '47c9efba-f25e-4ffe-be66-5c5e7f3a3e18')
INSERT INTO [dbo].[zzzRptValueImpactListing] ([Id_Number], [Id_Name], [VA], [VI_Impact], [Id_Assignees], [AgType], [Pj_Id]) VALUES (18, N'Pull off force harness: reduce spec', N'Complexity', CONVERT([decimal](18, 3),-50.000), NULL, N'Sum', '47c9efba-f25e-4ffe-be66-5c5e7f3a3e18')
INSERT INTO [dbo].[zzzRptValueImpactListing] ([Id_Number], [Id_Name], [VA], [VI_Impact], [Id_Assignees], [AgType], [Pj_Id]) VALUES (18, N'Pull off force harness: reduce spec', N'Complexity', CONVERT([decimal](18, 3),-50.000), NULL, N'Sum', '47c9efba-f25e-4ffe-be66-5c5e7f3a3e18')
INSERT INTO [dbo].[zzzRptValueImpactListing] ([Id_Number], [Id_Name], [VA], [VI_Impact], [Id_Assignees], [AgType], [Pj_Id]) VALUES (18, N'Pull off force harness: reduce spec', N'Mrk Conf', CONVERT([decimal](18, 3),6.000), NULL, N'Avg', '47c9efba-f25e-4ffe-be66-5c5e7f3a3e18')
INSERT INTO [dbo].[zzzRptValueImpactListing] ([Id_Number], [Id_Name], [VA], [VI_Impact], [Id_Assignees], [AgType], [Pj_Id]) VALUES (18, N'Pull off force harness: reduce spec', N'Mrk Conf', CONVERT([decimal](18, 3),6.000), NULL, N'Avg', '47c9efba-f25e-4ffe-be66-5c5e7f3a3e18')
INSERT INTO [dbo].[zzzRptValueImpactListing] ([Id_Number], [Id_Name], [VA], [VI_Impact], [Id_Assignees], [AgType], [Pj_Id]) VALUES (18, N'Pull off force harness: reduce spec', N'Prod Cost', CONVERT([decimal](18, 3),-0.040), NULL, N'Sum', '47c9efba-f25e-4ffe-be66-5c5e7f3a3e18')
INSERT INTO [dbo].[zzzRptValueImpactListing] ([Id_Number], [Id_Name], [VA], [VI_Impact], [Id_Assignees], [AgType], [Pj_Id]) VALUES (18, N'Pull off force harness: reduce spec', N'Prod Cost', CONVERT([decimal](18, 3),-0.040), NULL, N'Sum', '47c9efba-f25e-4ffe-be66-5c5e7f3a3e18')
INSERT INTO [dbo].[zzzRptValueImpactListing] ([Id_Number], [Id_Name], [VA], [VI_Impact], [Id_Assignees], [AgType], [Pj_Id]) VALUES (23, N'Simplify and stabilize contact process', N'Mrk Conf', CONVERT([decimal](18, 3),6.000), NULL, N'Avg', '47c9efba-f25e-4ffe-be66-5c5e7f3a3e18')
INSERT INTO [dbo].[zzzRptValueImpactListing] ([Id_Number], [Id_Name], [VA], [VI_Impact], [Id_Assignees], [AgType], [Pj_Id]) VALUES (23, N'Simplify and stabilize contact process', N'Prod Cost', CONVERT([decimal](18, 3),-0.320), NULL, N'Sum', '47c9efba-f25e-4ffe-be66-5c5e7f3a3e18')
INSERT INTO [dbo].[zzzRptValueImpactListing] ([Id_Number], [Id_Name], [VA], [VI_Impact], [Id_Assignees], [AgType], [Pj_Id]) VALUES (23, N'Simplify and stabilize contact process', N'Relblty', CONVERT([decimal](18, 3),1.500), NULL, N'Sum', '47c9efba-f25e-4ffe-be66-5c5e7f3a3e18')
INSERT INTO [dbo].[zzzRptValueImpactListing] ([Id_Number], [Id_Name], [VA], [VI_Impact], [Id_Assignees], [AgType], [Pj_Id]) VALUES (24, N'Decrease positioning tolerances to reduce distance between parts', N'Prod Cost', CONVERT([decimal](18, 3),-0.210), N'Mark Powel
Philipp Bart', N'Sum', '47c9efba-f25e-4ffe-be66-5c5e7f3a3e18')
INSERT INTO [dbo].[zzzRptValueImpactListing] ([Id_Number], [Id_Name], [VA], [VI_Impact], [Id_Assignees], [AgType], [Pj_Id]) VALUES (25, N'Separate extension of carrier material, than assembly by gluing', N'Complexity', CONVERT([decimal](18, 3),-20.000), NULL, N'Sum', '47c9efba-f25e-4ffe-be66-5c5e7f3a3e18')
INSERT INTO [dbo].[zzzRptValueImpactListing] ([Id_Number], [Id_Name], [VA], [VI_Impact], [Id_Assignees], [AgType], [Pj_Id]) VALUES (25, N'Separate extension of carrier material, than assembly by gluing', N'Prod Cost', CONVERT([decimal](18, 3),-0.230), NULL, N'Sum', '47c9efba-f25e-4ffe-be66-5c5e7f3a3e18')
INSERT INTO [dbo].[zzzRptValueImpactListing] ([Id_Number], [Id_Name], [VA], [VI_Impact], [Id_Assignees], [AgType], [Pj_Id]) VALUES (26, N'Use higher emission foam/fleece where possible', N'Mrk Conf', CONVERT([decimal](18, 3),7.000), N'Craig Squires
Stacy Johnson', N'Avg', '47c9efba-f25e-4ffe-be66-5c5e7f3a3e18')
INSERT INTO [dbo].[zzzRptValueImpactListing] ([Id_Number], [Id_Name], [VA], [VI_Impact], [Id_Assignees], [AgType], [Pj_Id]) VALUES (27, N'Reduce material variance fleece: width, composites, glue or not,', N'Complexity', CONVERT([decimal](18, 3),-5.000), N'Stacy Johnson', N'Sum', '47c9efba-f25e-4ffe-be66-5c5e7f3a3e18')
INSERT INTO [dbo].[zzzRptValueImpactListing] ([Id_Number], [Id_Name], [VA], [VI_Impact], [Id_Assignees], [AgType], [Pj_Id]) VALUES (28, N'Confidential', N'Relblty', CONVERT([decimal](18, 3),4.000), NULL, N'Sum', '47c9efba-f25e-4ffe-be66-5c5e7f3a3e18')
INSERT INTO [dbo].[zzzRptValueImpactListing] ([Id_Number], [Id_Name], [VA], [VI_Impact], [Id_Assignees], [AgType], [Pj_Id]) VALUES (29, N'Reduce material variance tape: width, composites', N'Complexity', CONVERT([decimal](18, 3),-3.000), N'Steve Stewart', N'Sum', '47c9efba-f25e-4ffe-be66-5c5e7f3a3e18')
INSERT INTO [dbo].[zzzRptValueImpactListing] ([Id_Number], [Id_Name], [VA], [VI_Impact], [Id_Assignees], [AgType], [Pj_Id]) VALUES (29, N'Reduce material variance tape: width, composites', N'Prod Cost', CONVERT([decimal](18, 3),-0.350), N'Steve Stewart', N'Sum', '47c9efba-f25e-4ffe-be66-5c5e7f3a3e18')
INSERT INTO [dbo].[zzzRptValueImpactListing] ([Id_Number], [Id_Name], [VA], [VI_Impact], [Id_Assignees], [AgType], [Pj_Id]) VALUES (29, N'Reduce material variance tape: width, composites', N'Relblty', CONVERT([decimal](18, 3),3.000), N'Steve Stewart', N'Sum', '47c9efba-f25e-4ffe-be66-5c5e7f3a3e18')
GO
-- TRANSACTION HANDLING
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN IF @@TRANCOUNT>0 ROLLBACK SET NOEXEC ON END
GO
IF @@TRANCOUNT>0
COMMIT
SET NOEXEC OFF
GO
Here's the code for the rdl file:
<?xml version="1.0" encoding="utf-8"?>
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
<Body>
<ReportItems>
<Tablix Name="matrix1">
<TablixCorner>
<TablixCornerRows>
<TablixCornerRow>
<TablixCornerCell>
<CellContents>
<Textbox Name="textbox3">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>#</Value>
<Style>
<FontWeight>Bold</FontWeight>
<Color>#054974</Color>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>textbox3</rd:DefaultName>
<ToolTip>Idea Number</ToolTip>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>Solid</Style>
</Border>
<BackgroundColor>#fafafa</BackgroundColor>
<VerticalAlign>Middle</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCornerCell>
<TablixCornerCell>
<CellContents>
<Textbox Name="Textbox13">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Idea</Value>
<Style>
<FontWeight>Bold</FontWeight>
<Color>#054974</Color>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Left</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox13</rd:DefaultName>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>Solid</Style>
</Border>
<BackgroundColor>#fafafa</BackgroundColor>
<VerticalAlign>Middle</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCornerCell>
<TablixCornerCell>
<CellContents>
<Textbox Name="Textbox1">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Assignees</Value>
<Style>
<FontWeight>Bold</FontWeight>
<Color>#054974</Color>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Left</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox1</rd:DefaultName>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>Solid</Style>
</Border>
<BackgroundColor>#fafafa</BackgroundColor>
<VerticalAlign>Middle</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCornerCell>
</TablixCornerRow>
</TablixCornerRows>
</TablixCorner>
<TablixBody>
<TablixColumns>
<TablixColumn>
<Width>0.95in</Width>
</TablixColumn>
</TablixColumns>
<TablixRows>
<TablixRow>
<Height>0.3in</Height>
<TablixCells>
<TablixCell>
<CellContents>
<Textbox Name="textbox2">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Sum(Fields!VI_Impact.Value)</Value>
<Style>
<Format>#,###.###</Format>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Right</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>textbox2</rd:DefaultName>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>None</Style>
</Border>
<TopBorder>
<Color>LightGrey</Color>
<Style>Solid</Style>
</TopBorder>
<BottomBorder>
<Color>LightGrey</Color>
<Style>Solid</Style>
</BottomBorder>
<LeftBorder>
<Color>LightGrey</Color>
<Style>Solid</Style>
</LeftBorder>
<RightBorder>
<Color>LightGrey</Color>
<Style>Solid</Style>
</RightBorder>
<VerticalAlign>Middle</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>4pt</PaddingRight>
<PaddingTop>3pt</PaddingTop>
<PaddingBottom>3pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
<DataElementOutput>Output</DataElementOutput>
</TablixCell>
</TablixCells>
</TablixRow>
<TablixRow>
<Height>0.25in</Height>
<TablixCells>
<TablixCell>
<CellContents>
<Textbox Name="VI_Impact">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Sum(Fields!VI_Impact.Value)</Value>
<Style>
<FontWeight>Bold</FontWeight>
<Format>#,###.###</Format>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Right</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>VI_Impact</rd:DefaultName>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>None</Style>
</Border>
<TopBorder>
<Color>LightGrey</Color>
<Style>Solid</Style>
</TopBorder>
<BottomBorder>
<Color>LightGrey</Color>
<Style>Solid</Style>
</BottomBorder>
<LeftBorder>
<Color>LightGrey</Color>
<Style>Solid</Style>
</LeftBorder>
<RightBorder>
<Color>LightGrey</Color>
<Style>Solid</Style>
</RightBorder>
<VerticalAlign>Middle</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>4pt</PaddingRight>
<PaddingTop>3pt</PaddingTop>
<PaddingBottom>3pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
<DataElementOutput>Output</DataElementOutput>
</TablixCell>
</TablixCells>
</TablixRow>
</TablixRows>
</TablixBody>
<TablixColumnHierarchy>
<TablixMembers>
<TablixMember>
<Group Name="matrix1_VA">
<GroupExpressions>
<GroupExpression>=Fields!VA.Value</GroupExpression>
</GroupExpressions>
</Group>
<SortExpressions>
<SortExpression>
<Value>=Fields!VA.Value</Value>
</SortExpression>
</SortExpressions>
<TablixHeader>
<Size>0.3in</Size>
<CellContents>
<Textbox Name="VA">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!VA.Value</Value>
<Style>
<FontWeight>Bold</FontWeight>
<Color>#054974</Color>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Right</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>VA</rd:DefaultName>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>Solid</Style>
</Border>
<BackgroundColor>WhiteSmoke</BackgroundColor>
<VerticalAlign>Middle</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>4pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixHeader>
<DataElementOutput>Output</DataElementOutput>
<KeepTogether>true</KeepTogether>
</TablixMember>
</TablixMembers>
</TablixColumnHierarchy>
<TablixRowHierarchy>
<TablixMembers>
<TablixMember>
<Group Name="Id_Pj_Id">
<GroupExpressions>
<GroupExpression>=Fields!Pj_Id.Value</GroupExpression>
</GroupExpressions>
</Group>
<SortExpressions>
<SortExpression>
<Value>=Fields!Id_Number.Value</Value>
</SortExpression>
</SortExpressions>
<TablixMembers>
<TablixMember>
<Group Name="matrix1_Id_Number">
<GroupExpressions>
<GroupExpression>=Fields!Id_Number.Value</GroupExpression>
</GroupExpressions>
</Group>
<SortExpressions>
<SortExpression>
<Value>=Fields!Id_Number.Value</Value>
</SortExpression>
</SortExpressions>
<TablixHeader>
<Size>0.4in</Size>
<CellContents>
<Textbox Name="Id_Number">
<CanGrow>true</CanGrow>
<CanShrink>true</CanShrink>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!Id_Number.Value</Value>
<Style />
</TextRun>
</TextRuns>
<Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Id_Number</rd:DefaultName>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>Solid</Style>
</Border>
<BottomBorder>
<Color>LightGrey</Color>
</BottomBorder>
<VerticalAlign>Middle</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixHeader>
<TablixMembers>
<TablixMember>
<Group Name="matrix1_Id_Name">
<GroupExpressions>
<GroupExpression>=Fields!Id_Name.Value</GroupExpression>
</GroupExpressions>
</Group>
<SortExpressions>
<SortExpression>
<Value>=Fields!Id_Name.Value</Value>
</SortExpression>
</SortExpressions>
<TablixHeader>
<Size>4.81979in</Size>
<CellContents>
<Textbox Name="Id_Name">
<CanGrow>true</CanGrow>
<CanShrink>true</CanShrink>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!Id_Name.Value</Value>
<Style />
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Id_Name</rd:DefaultName>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>None</Style>
</Border>
<TopBorder>
<Style>Solid</Style>
</TopBorder>
<BottomBorder>
<Color>LightGrey</Color>
<Style>Solid</Style>
</BottomBorder>
<VerticalAlign>Middle</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>3pt</PaddingTop>
<PaddingBottom>3pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixHeader>
<TablixMembers>
<TablixMember>
<TablixHeader>
<Size>1.33333in</Size>
<CellContents>
<Textbox Name="Id_Assignees">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!Id_Assignees.Value</Value>
<Style />
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Id_Assignees</rd:DefaultName>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>None</Style>
</Border>
<TopBorder>
<Color>LightGrey</Color>
<Style>Solid</Style>
</TopBorder>
<BottomBorder>
<Color>LightGrey</Color>
<Style>Solid</Style>
</BottomBorder>
<LeftBorder>
<Color>LightGrey</Color>
<Style>Solid</Style>
</LeftBorder>
<RightBorder>
<Color>LightGrey</Color>
<Style>Solid</Style>
</RightBorder>
<VerticalAlign>Middle</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>3pt</PaddingTop>
<PaddingBottom>3pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixHeader>
</TablixMember>
</TablixMembers>
<DataElementOutput>Output</DataElementOutput>
<KeepTogether>true</KeepTogether>
</TablixMember>
</TablixMembers>
<DataElementOutput>Output</DataElementOutput>
</TablixMember>
<TablixMember>
<TablixHeader>
<Size>0.4in</Size>
<CellContents>
<Textbox Name="Textbox35">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value />
<Style />
</TextRun>
</TextRuns>
<Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox35</rd:DefaultName>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>None</Style>
</Border>
<VerticalAlign>Middle</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixHeader>
<TablixMembers>
<TablixMember>
<TablixHeader>
<Size>4.81979in</Size>
<CellContents>
<Textbox Name="Textbox36">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value />
<Style>
<FontWeight>Bold</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Right</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox36</rd:DefaultName>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>None</Style>
</Border>
<VerticalAlign>Middle</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>4pt</PaddingRight>
<PaddingTop>3pt</PaddingTop>
<PaddingBottom>3pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixHeader>
<TablixMembers>
<TablixMember>
<TablixHeader>
<Size>1.33333in</Size>
<CellContents>
<Textbox Name="Textbox6">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Totals</Value>
<Style>
<FontWeight>Bold</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Right</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox6</rd:DefaultName>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>None</Style>
</Border>
<VerticalAlign>Middle</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>4pt</PaddingRight>
<PaddingTop>3pt</PaddingTop>
<PaddingBottom>3pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixHeader>
</TablixMember>
</TablixMembers>
</TablixMember>
</TablixMembers>
<KeepWithGroup>Before</KeepWithGroup>
</TablixMember>
</TablixMembers>
</TablixMember>
</TablixMembers>
</TablixRowHierarchy>
<RepeatColumnHeaders>true</RepeatColumnHeaders>
<RepeatRowHeaders>true</RepeatRowHeaders>
<DataSetName>DataSet1</DataSetName>
<Top>0.30375in</Top>
<Height>0.85in</Height>
<Width>7.50312in</Width>
<Style />
</Tablix>
</ReportItems>
<Height>1.845in</Height>
<Style />
</Body>
<Width>8.42925in</Width>
<Page>
<PageHeight>8.5in</PageHeight>
<PageWidth>14in</PageWidth>
<LeftMargin>0.25in</LeftMargin>
<RightMargin>0.25in</RightMargin>
<TopMargin>0.25in</TopMargin>
<BottomMargin>0.25in</BottomMargin>
<Style />
</Page>
<AutoRefresh>0</AutoRefresh>
<DataSources>
<DataSource Name="VEMasterDataSource">
<DataSourceReference>VEMasterDataSource</DataSourceReference>
<rd:SecurityType>None</rd:SecurityType>
<rd:DataSourceID>c76f7aa3-8f20-4495-a1bf-0b7a2ede98e3</rd:DataSourceID>
</DataSource>
</DataSources>
<DataSets>
<DataSet Name="DataSet1">
<Query>
<DataSourceName>VEMasterDataSource</DataSourceName>
<CommandText>select * from zzzRptValueImpactListing</CommandText>
<rd:UseGenericDesigner>true</rd:UseGenericDesigner>
</Query>
<Fields>
<Field Name="Id_Number">
<DataField>Id_Number</DataField>
<rd:TypeName>System.Int32</rd:TypeName>
</Field>
<Field Name="Id_Name">
<DataField>Id_Name</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="VA">
<DataField>VA</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="VI_Impact">
<DataField>VI_Impact</DataField>
<rd:TypeName>System.Decimal</rd:TypeName>
</Field>
<Field Name="Id_Assignees">
<DataField>Id_Assignees</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="AgType">
<DataField>AgType</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="Pj_Id">
<DataField>Pj_Id</DataField>
<rd:TypeName>System.Guid</rd:TypeName>
</Field>
</Fields>
</DataSet>
</DataSets>
<Language>en-US</Language>
<ConsumeContainerWhitespace>true</ConsumeContainerWhitespace>
<rd:ReportUnitType>Inch</rd:ReportUnitType>
<rd:ReportID>86e382ea-6e9e-46b0-a5c1-7bf67abfdcf5</rd:ReportID>
</Report> -
Change Header name in a Matrix Table
Hi guys,
I have a matrix table which looks like below image 1 and returns me a result like image 2. Can someone help me how to rename those column names as referred to image 2 please? For example: Column "1" should be called "System Score 1".
And so on. Thanks in advance.
artistdedigitalUse Switch statement for the column header expression like below
=Switch( Fields!ID_Complete.Value =1, "System Score 1",
Fields!ID_Complete.Value = 2, "System Score 2",
Fields!ID_Complete.Value = 3, "System Score 3" )
Follow below link for more details.
link -
Hello,
Is it possible to make a query thats create a matrix table.
select * from TCOLUMN
ID NAME
== ====
1 A
2 B
select * from TROW
ID NAME
== ====
1 X
2 Y
select * from TMATRIX
TCOLUMN_ID TROW_ID VAL
========== ======== ==
1 1 k
1 2 m
2 1 l
2 2 n
The query have to display:
null X Y
A k m
B l n
Thanks.Like this?
SQL> column name format a4 heading "null"
SQL> column x format a4 heading "X"
SQL> column y format a4 heading "Y"
SQL> create table tcolumn
2 as
3 select 1 id, 'A' name from dual union all
4 select 2, 'B' from dual
5 /
Tabel is aangemaakt.
SQL> create table trow
2 as
3 select 1 id, 'X' name from dual union all
4 select 2, 'Y' from dual
5 /
Tabel is aangemaakt.
SQL> create table tmatrix
2 as
3 select 1 tcolumn_id, 1 trow_id, 'k' val from dual union all
4 select 1, 2, 'm' from dual union all
5 select 2, 1, 'l' from dual union all
6 select 2, 2, 'n' from dual
7 /
Tabel is aangemaakt.
SQL> select c.name
2 , max(decode(r.name,'X',m.val)) x
3 , max(decode(r.name,'Y',m.val)) y
4 from tmatrix m
5 , tcolumn c
6 , trow r
7 where m.tcolumn_id = c.id
8 and m.trow_id = r.id
9 group by c.name
10 /
null X Y
A k m
B l n
2 rijen zijn geselecteerd.Groet,
Rob. -
Urgent help required in creating matrix table report
Hi
I need a report in the below format with subtotal and total and custom order of columns and rows. I tried in using grouping and conditional region format but i am not getting the exact result.
product2 product 1 product 3 Total
Asia
India 10 20 30 60
Europe
london 20 30 40 90
Germany 30 40 50 120
Europe total 50 70 90 210
Full total 60 90 120 270
india,london,germany in field region
product 1, product2 product3 in field sales
measures in total amount field
I tried to use the pivot table but their no option for total and custom ordering for rows and columns and i am not getting the exact format. Please suggest me a method or procedure to get exact result as shown above.
Thanks and regards
sandy
Edited by: user2989722 on Mar 31, 2010 11:45 PMhi
I am attaching my xml please help me out in creating a matrix report.
<?xml version="1.0" encoding="UTF-8" ?>
- <ROWSET>
- <ROW>
<_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>1.Wholesale</_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>
<_FCT_NON_SEC_EXP_20090331_._PD_Range_>PD 1 [0 - .15]%</_FCT_NON_SEC_EXP_20090331_._PD_Range_>
<_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>2307.165535041</_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>
<_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>0.475123902700634</_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>30.2162475006637</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>
<_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>1632.57338858</_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>422.436554415462</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>
</ROW>
- <ROW>
<_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>1.Wholesale</_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>
<_FCT_NON_SEC_EXP_20090331_._PD_Range_>PD 10 (10 - 20]%</_FCT_NON_SEC_EXP_20090331_._PD_Range_>
<_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>17137.13228197</_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>
<_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>0.405705629282986</_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>207.096250125078</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>
<_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>5783.36069429</_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>26.7447698210976</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>
</ROW>
- <ROW>
<_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>1.Wholesale</_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>
<_FCT_NON_SEC_EXP_20090331_._PD_Range_>PD 11 (20 - 100]%</_FCT_NON_SEC_EXP_20090331_._PD_Range_>
<_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>176.01654684</_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>
<_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>0.507714108946292</_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>281.219317996251</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>
<_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>6.35288644</_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>33.5503479625902</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>
</ROW>
- <ROW>
<_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>1.Wholesale</_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>
<_FCT_NON_SEC_EXP_20090331_._PD_Range_>PD 12 Default</_FCT_NON_SEC_EXP_20090331_._PD_Range_>
<_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>4701.426500882</_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>
<_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>0.448602202841554</_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>100.000000024971</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>
<_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>722.25731111</_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>17.1137302584326</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>
</ROW>
- <ROW>
<_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>1.Wholesale</_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>
<_FCT_NON_SEC_EXP_20090331_._PD_Range_>PD 4 (.35 - .5]%</_FCT_NON_SEC_EXP_20090331_._PD_Range_>
<_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>20075.347155131</_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>
<_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>0.435471063386539</_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>65.043256695741</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>
<_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>19214.33530761</_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>39.8394919447153</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>
</ROW>
- <ROW>
<_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>1.Wholesale</_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>
<_FCT_NON_SEC_EXP_20090331_._PD_Range_>PD 6 (.75 - 1.35]%</_FCT_NON_SEC_EXP_20090331_._PD_Range_>
<_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>55148.040085827</_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>
<_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>0.406837969201374</_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>90.9915692969898</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>
<_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>35168.28645631</_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>24.2323573228287</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>
</ROW>
- <ROW>
<_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>1.Wholesale</_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>
<_FCT_NON_SEC_EXP_20090331_._PD_Range_>PD 7 (1.35 - 2.5]%</_FCT_NON_SEC_EXP_20090331_._PD_Range_>
<_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>80782.306502494</_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>
<_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>0.401398105436061</_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>104.939383907255</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>
<_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>29327.09937088</_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>64.5404944514989</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>
</ROW>
- <ROW>
<_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>1.Wholesale</_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>
<_FCT_NON_SEC_EXP_20090331_._PD_Range_>PD 9 (5.5 - 10]%</_FCT_NON_SEC_EXP_20090331_._PD_Range_>
<_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>19918.353466582</_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>
<_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>0.403197283094678</_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>145.38568228759</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>
<_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>6968.38716055</_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>22.4602872356297</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>
</ROW>
- <ROW>
<_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>1.Wholesale</_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>
<_FCT_NON_SEC_EXP_20090331_._PD_Range_>PD3 (.25 - .35]%</_FCT_NON_SEC_EXP_20090331_._PD_Range_>
<_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>4659.00625848</_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>
<_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>0.437222745016593</_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>49.7763165044685</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>
<_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>6328.43285318</_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>56.9420433188724</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>
</ROW>
- <ROW>
<_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>2.Residential Mortgage</_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>
<_FCT_NON_SEC_EXP_20090331_._PD_Range_>PD 1 [0 - .15]%</_FCT_NON_SEC_EXP_20090331_._PD_Range_>
<_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>92099.47315523</_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>
<_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>0.49290316215652</_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>8.1614679611239</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>
<_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>40865.81313468</_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>0.490255140986887</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>
</ROW>
- <ROW>
<_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>2.Residential Mortgage</_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>
<_FCT_NON_SEC_EXP_20090331_._PD_Range_>PD 10 (10 - 20]%</_FCT_NON_SEC_EXP_20090331_._PD_Range_>
<_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>5978.77892414</_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>
<_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>0.462986581515473</_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>236.956154182651</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>
<_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>38.17433944</_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>0.220028397461449</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>
</ROW>
- <ROW>
<_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>2.Residential Mortgage</_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>
<_FCT_NON_SEC_EXP_20090331_._PD_Range_>PD 11 (20 - 100]%</_FCT_NON_SEC_EXP_20090331_._PD_Range_>
<_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>7996.70429901</_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>
<_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>0.487633014729318</_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>211.059294848823</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>
<_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>67.39087733</_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>0.262386150656619</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>
</ROW>
- <ROW>
<_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>2.Residential Mortgage</_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>
<_FCT_NON_SEC_EXP_20090331_._PD_Range_>PD 12 Default</_FCT_NON_SEC_EXP_20090331_._PD_Range_>
<_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>5680.79501712</_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>
<_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>0.364996338745224</_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>100.000000120142</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>
<_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>9.44825003</_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>0.274957460858617</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>
</ROW>
- <ROW>
<_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>2.Residential Mortgage</_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>
<_FCT_NON_SEC_EXP_20090331_._PD_Range_>PD 2 (.15 - .25]%</_FCT_NON_SEC_EXP_20090331_._PD_Range_>
<_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>18412.32474058</_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>
<_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>0.565813759474568</_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>22.0959615585123</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>
<_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>3375.14793919</_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>0.31511224146282</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>
</ROW>
- <ROW>
<_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>2.Residential Mortgage</_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>
<_FCT_NON_SEC_EXP_20090331_._PD_Range_>PD 4 (.35 - .5]%</_FCT_NON_SEC_EXP_20090331_._PD_Range_>
<_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>8998.50534758</_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>
<_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>0.564193157888767</_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>38.7032364619711</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>
<_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>742.52198983</_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>0.259162668085142</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>
</ROW>
- <ROW>
<_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>2.Residential Mortgage</_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>
<_FCT_NON_SEC_EXP_20090331_._PD_Range_>PD 5 (.5 - .75]%</_FCT_NON_SEC_EXP_20090331_._PD_Range_>
<_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>8566.81402593</_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>
<_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>0.551881376840796</_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>49.4634096178362</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>
<_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>404.85624382</_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>2.51892931053278</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>
</ROW>
- <ROW>
<_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>2.Residential Mortgage</_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>
<_FCT_NON_SEC_EXP_20090331_._PD_Range_>PD 6 (.75 - 1.35]%</_FCT_NON_SEC_EXP_20090331_._PD_Range_>
<_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>10002.21838595</_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>
<_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>0.530272891319008</_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>66.6791470811157</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>
<_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>404.88147998</_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>0.212464766871609</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>
</ROW>
- <ROW>
<_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>2.Residential Mortgage</_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>
<_FCT_NON_SEC_EXP_20090331_._PD_Range_>PD 7 (1.35 - 2.5]%</_FCT_NON_SEC_EXP_20090331_._PD_Range_>
<_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>10005.26092357</_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>
<_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>0.500044162824778</_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>93.5636951722772</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>
<_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>-490.56397567</_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>46.4764541038698</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>
</ROW>
- <ROW>
<_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>2.Residential Mortgage</_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>
<_FCT_NON_SEC_EXP_20090331_._PD_Range_>PD 8 (2.5 - 5.5]%</_FCT_NON_SEC_EXP_20090331_._PD_Range_>
<_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>11226.21172151</_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>
<_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>0.468571958403512</_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>131.927474849119</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>
<_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>110.85147102</_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>0.214124061873538</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>
</ROW>
- <ROW>
<_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>2.Residential Mortgage</_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>
<_FCT_NON_SEC_EXP_20090331_._PD_Range_>PD 9 (5.5 - 10]%</_FCT_NON_SEC_EXP_20090331_._PD_Range_>
<_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>5963.41956141</_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>
<_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>0.466066773663567</_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>185.088689160792</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>
<_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>51.01957931</_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>0.224693875694723</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>
</ROW>
- <ROW>
<_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>2.Residential Mortgage</_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>
<_FCT_NON_SEC_EXP_20090331_._PD_Range_>PD3 (.25 - .35]%</_FCT_NON_SEC_EXP_20090331_._PD_Range_>
<_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>9956.41682925</_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>
<_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>0.55994575388673</_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>29.9353533062809</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>
<_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>1216.31690239</_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>0.28824424910818</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>
</ROW>
> -
How to create a Matrix table using this data in SQL Query Analyzer
Hello all,
I have a problem while I am trying to represent my Sql Table namely table1 in Matrix form
my table Format is
city1 city2 Distance--------------------------------------------------------
Mumbai Delhi 100
Delhi Banaras 50
Mumbai Rajasthan 70
Banaras haryana 40
Mumbai Mumbai 0
784 entries
there are 784 cities each having link to other
Now i want my output as
Mumbai Delhi Banaras haryana
Mumbai 0 100 -- --
Delhi 100 0 50 --
Banaras
haryana
respective distance from one city to other should be shown
final Matrix would be 784*784
I am using SQL Query Analyser for this
Please help me in this regardI'm pretty much certain that you don't want to do this in pure SQL. So that means that you want to do it with a reporting tool. I'm not familiar with SQL Query Analyzer, but if it is in fact a reporting tool you'll want to consult its documentation looking for the terms "pivot" or perhaps "cross tab."
-
Dear gurus,
I want my output to print on Dot-Matrix printer,
Everything is fine till i try to print a table with outline in it.
I mean if i use a outline or a border for my table the whole table is displayed as a big black window.
Now if i don't use the border or outline then the whole data of the table is printed without the border.
Please help me to solve the issue.
Regards,
Roshan Lilaram.Can you try to print in a different printer, if the error persists then the problem is in the smartform, otherwise raise a note to SAP regarding this. I think that there is problem is with the page format in which u are taking the printout.
OR
Can you check if you have selected the framed border in the table border select pattern.
Hope That Helps
Anirban M. -
SSRS How to pass subtotal value in matrix into another table just for display?
Hi all,
I have two matrix with subtotal for two grouping. I need to pass the value of this two group subtotal into another matrix table to display and perform simple calculation to get the differences.
How can I pass the subtotal amount into the other matrix?
In Crystal report I can define two variable where i can set the total to the value and call the two variable anywhere in the same report. But how can I do it in SSRS?
Appreciate can help
Thank youYes, basically both are same grouping, i just want to capture the subtotal for comparision with scenario 2.
I can do it in SQL, but if possible, I hope to do it in report. Thank you
Simulation as below
Matrix for scenario 1
Group 1
Detail
Detail
Subtotal Group 1
9999
group 2
Detail
Detail
SubTotal Group 2
8888
Matrix for scenario 2
Group 1
Scenario2
Scenario 1
Differences
Detail
Detail
Subtotal Group 1
2000
9999
2000-9999
group 2
Detail
Detail
SubTotal Group 2
3000
8888
3000-8888 -
SSRS - % percentage ROW TOTALS don't calculate correctly in a Table Matrix
SSRS - Report Builder 3.0
I have created a report with a MATRIX table with a TOTAL ROW and a TOTAL COLUMN and the total column is calculating correctly but the ROW totals is not calculating correctly
The screen shot below is of the Matrix table in the Report Builder 3.0 "Designer view"
When I run the report the column totals the percentage is averaged correctly, but the ROW TOTALS do not, some are close but i need them to be accurate.
If you take the same data into excel the total percentage calculates correctly - if you compare the excel with the SSRS some rows do calculate close, but not accurate. the total column calculates correctly
FY13-Q4
FY14-Q1
FY14-Q2
FY14-Q3
Total
100%
89%
65%
68%
80%
50%
72%
43%
45%
52%
100%
91%
63%
69%
81%
10%
17%
29%
31%
22%
100%
96%
67%
76%
85%
70%
70%
53%
64%
64%
90%
93%
90%
82%
89%
74%
75%
59%
62%
68%
I Need the totals rows and columns to average the percentage correctly in the SSRS report.
Please help...
-IsaackHi Katherine Xiong,
The formula (SSRS Expression) i am using is the following
=Sum(IIf(Fields!AnswerText.Value = "Yes", 1, 0)) / (Sum(IIf(Fields!AnswerText.Value = "No", 1, 0)) + Sum(IIf(Fields!AnswerText.Value = "Yes", 1, 0)) + Sum(IIf(Fields!AnswerText.Value
= "n/a", 0, 0)))
Basically if field value = "YES" it counts, if the answer = "No" if the value is = "n/a" it should not count in the total score percentage
I get the correct PERCENTAGE on the 1st aggregate, but when the table has multiple aggregates the percentage is never accurate.
The Table below is using the above formula, the 1st aggregate is correct but if you get the average percentage from the 1st column it should be 86.2% is the accurate number, sometimes close but i want to report accurate numbers and not doubt SSRS reports
compared to excel reports.
TOTAL ROW (highlighted on the screenshot in Yellow) is incorrect aggregate averages %, the correct average are the following
[86.2%] [71.5%] [75.5%] [87.87%] [90.2%] [69.9%] [92.8%]
-Isaack -
J2ME Device Table / Matrix vanished from sun website
No so long ago Sun hosted a matrix / table of devices which supported J2ME. This was a very cool resource as it made it very easy to find out which devices supported what features.
I found these items in the web archive :
http://web.archive.org/web/20060316042422/http://developers.sun.com/techtopics/mobility/device
http://web.archive.org/web/20070824222640rn_2/developers.sun.com/mobility/device/device
However when looking on the sun website they seem to have vanished. Any ideas where I can find similar information. I found the Nokia site already, but that only includes details on Nokia phones.- if you click on the old location of this page: [http://developers.sun.com/techtopics/mobility/device|http://developers.sun.com/techtopics/mobility/device]
-- it will redirect you to another page, [http://java.sun.com/javame/index.jsp#devicematrix|http://java.sun.com/javame/index.jsp#devicematrix]
--- which explains how you can get that information now:
>
The Java ME technology Device Matrix has been replaced by a database included with the [Java ME SDK 3.0|http://java.sun.com/javame/downloads/sdk30.jsp], which lets you find technical specifications on mobile devices using the built-in WURFL database search engine. Over 8000 mobile device specifications are available from the Java ME SDK.
>
is there something in explanation above that is difficult to understand? -
Hello, Expert,
Could you please help me with the following problem? Thanks in advance!
I have designed the matrix report (SSRS 2012) with database table structure looks like below.
Week
Version
Count
Week1
V1.1
4000
Week1
V1.2
4000
Week1
V1.3
4000
Week2
V1.1
3000
Week2
V1.2
3000
Week2
V1.3
3000
Week3
V1.1
2000
Week3
V1.2
2000
Week3
V1.3
2000
Week4
V1.1
1000
Week4
V1.2
1000
Week4
V1.3
1000
The matrix report displays like below. Column grows based on no of Week in the table.
Week1
Week2
Week3
Week4
V1.1
4000
3000
2000
1000
V1.2
4000
3000
2000
1000
V1.3
4000
3000
2000
1000
What I want to do now is: instead of the Count values, I need to calculate the percentage of each week over the
Count in Week1 so that each cell displays Count(Week2)/Count(Week1), Count(Week3)/Count(Week1), etc. What is the SSRS expression for that? I’m new to SSRS, Please help!Heidi,
Thank you so much for your reply and solution! Now I know how to get the first field in a group. But I can't apply your solution directly just yet because in order to explain my problem I simplified my data structure. My real data structure has a nested
group like this:
Week VersionMajor VersionMinor Count
Week1 V1 V1.1 2000
Week2 V1 V1.1 1500
Week3 V1 V1.1 800
Week1 V1 V1.2 1000
Week2 V1 V1.2 500
Week3 V1 V1.2 200
Week1 V1 V1.1 2000
Week2 V1 V1.1 1500
Week3 V1 V1.1 800
Week1 V1 V1.2 1000
Week2 V1 V1.2 500
Week3 V1 V1.2 200
Here is the query for the above data:
SELECT 'Week1' AS Week, 'V1' AS VersionMajor, 'V1.1' AS VersionMinor, 2000 AS Count
UNION ALL
SELECT 'Week2' AS Week, 'V1' AS VersionMajor, 'V1.1' AS VersionMinor, 1500 AS Count
UNION ALL
SELECT 'Week3' AS Week, 'V1' AS VersionMajor, 'V1.1' AS VersionMinor, 800 AS Count
UNION ALL
SELECT 'Week1' AS Week, 'V1' AS VersionMajor, 'V1.2' AS VersionMinor, 1000 AS Count
UNION ALL
SELECT 'Week2' AS Week, 'V1' AS VersionMajor, 'V1.2' AS VersionMinor, 500 AS Count
UNION ALL
SELECT 'Week3' AS Week, 'V1' AS VersionMajor, 'V1.2' AS VersionMinor, 200 AS Count
UNION ALL
SELECT 'Week1' AS Week, 'V1' AS VersionMajor, 'V1.1' AS VersionMinor, 2000 AS Count
UNION ALL
SELECT 'Week2' AS Week, 'V1' AS VersionMajor, 'V1.1' AS VersionMinor, 1500 AS Count
UNION ALL
SELECT 'Week3' AS Week, 'V1' AS VersionMajor, 'V1.1' AS VersionMinor, 800 AS Count
UNION ALL
SELECT 'Week1' AS Week, 'V1' AS VersionMajor, 'V1.2' AS VersionMinor, 1000 AS Count
UNION ALL
SELECT 'Week2' AS Week, 'V1' AS VersionMajor, 'V1.2' AS VersionMinor, 500 AS Count
UNION ALL
SELECT 'Week3' AS Week, 'V1' AS VersionMajor, 'V1.2' AS VersionMinor, 200 AS Count
And my matrix table looks like this:
What I need to do is to calculate the percentage of each week over week1 for
1) V1 Total
2) V1.1
3) V1.2
I can't use your solution directly because I need to apply Sum function for each cell and the Sum function gives me error when I try to use it on the denominator
First(Fields!Count.Value,"VersionMinor"). If you could help me further to get to the final solution, I'd really appreciate it!!
Happy New Year! -
SSRS 2008 R2 matrix layout issue
Hi, I am working on a report where I have to report total number of tickets resolved per Resource in a week and I get the total number of tickets from a different table and issues resolved from another and most of the aggregation I do it in my dataset and
display it as a matrix report.
The problem I am running into is for instance my layout looks something like below. My data will be I will have 4 records for 2014 week-2 and for each resource will have a Total of 57 tickets and the same for week-3 and when I do the total for Atlanta the
total I get is 57 * 4 + 39 * 4 instead of staright 57 + 39. Please guide me fix this.
Region Year Week Total Resource1 Resource2 Resource3 Resource4
Atlanta 2014 2 57 16 7 8 12
3 39 8 9
13 1
Thanks in advance..............
IoneWhat is the formula in the total column?
The layout looks like a matrix, is it?
How did you add the total column to the matrix/table?
What fields are returned by the 2 datasets?
The *4 issue seems to indicate that the dataset that returns total has multiple rows (1 per resource) that includes the same total value for each region/year/week and that the formula in the total cell is summing the values of the dataset rows. If this is
the case then the issue may be cleared up by simply eliminating the multiple rows in that dataset. That may mean removing the resource field from that dataset's select list or adding the DISTINCT keyword to the select (assuming it is TSQL).
"You will find a fortune, though it will not be the one you seek." -
Blind Seer, O Brother Where Art Thou
Please Mark posts as answers or helpful so that others may find the fortune they seek. -
I have a SSRS report which uses a matrix for a crosstab effect.
Each row contains about 10 score values in 10 columns respectively. I need each row to check against the previous row, and i need each score value in each column to be compared to the corresponding column score value in the previous row.
If the current score is greater than the corresponding previous score (in the previous row), then i want to change the background of the cell.
if the current score is smaller than the previous, then it's a different color.
if they are equal, or it's the first row in the matrix table, then leave white.
I have found custom code functions to use in the SSRS expression fields, but every single one of them compares against the previous COLUMN value and not the previous ROW value which is what i need. the "Previous" function would be perfect if i
could use it in a matrix but i can't. (i keep getting error "The use of a Previous aggregate function in a tablix cell is not supported"). looking around it turns out that matrices are arrange in groups and not in rows which is why Previous can't
be used and the only way is with custom code.
Please help. if you have any custom code samples that achieve what i need, please share, or give me advice on how to achieve this.
Thank youI figured it out. Maybe it can help someone else in the future:
Public Shared count as Integer = 0
Public Shared currentRow As Integer = 1
Public Shared MatrixStructures As New System.Collections.Generic.List(Of MatrixStructure)()
Public Shared Function GetCellColor(row as Integer, score as Integer)
If (row > currentRow) Then
count = 0
currentRow = row
End If
count = count + 1
Dim matrixStructure As New MatrixStructure()
matrixStructure.RowIndex = row
matrixStructure.ColumnIndex = count
matrixStructure.ScoreValue = score
MatrixStructures.Add(matrixStructure)
If score = 0 Then
Return "White"
End If
Dim val As MatrixStructure = MatrixStructures.Find(Function(s As MatrixStructure)
Return s.GetRowIndex() = row - 1 AndAlso s.GetColumnIndex() = count
End Function)
If (Not (val Is Nothing)) Then
If val.scoreValue = 0 Then
Return "White"
End If
If score >= val.scoreValue + 2 Then
Return "Green"
ElseIf score <= val.scoreValue - 2 Then
Return "Red"
End If
End If
Return "White"
End Function
Public Class MatrixStructure
Public rowIndex As Integer
Property GetRowIndex() As Integer
Get
Return rowIndex
End Get
Set(ByVal Value As Integer)
rowIndex = Value
End Set
End Property
Public columnIndex As Integer
Property GetColumnIndex() As Integer
Get
Return columnIndex
End Get
Set(ByVal Value As Integer)
columnIndex = Value
End Set
End Property
Public scoreValue As Integer
Property GetScoreValue () As Integer
Get
Return scoreValue
End Get
Set(ByVal Value As Integer)
scoreValue = Value
End Set
End Property
End Class
and to pass the current row number from the expression i use this
Ceiling(RowNumber(NOTHING) / 10)
i divide the row number by 10 because there are ten columns. if you don't know the number of columns, or it's a variable number, then return it from the stored procedure query in the first place. that's what I had to do -
Table Store Table Format in SBO Plzzz
i have a problem when apply to condition to delivery form (140). When I Manipulate Matrix Table Line Item
(oTmpForm.Items("38").Specific.Columns.Item("1").Editable = False ) then it will be the default setting for sbo (Press Ctrl+B in Form to Check It).one time when specific condition occured i want to make it the editable=True( we cannot do that off course because item 38 is SBO's default item). I think i can make the editable=true by using recordset to update the Table Format Table in SBO. The Problem is What is the name of The Table .
Can someone helps me ?
Thanks.can you use Delivery Business Object instead of recordset?
But if we could know the table to define form definition, it's a good knowledge too.
Wait for the answer.
Jemmy
Maybe you are looking for
-
Error message with Vista and 7.2: Windows-No Disk Exception Processing Mess
I just got a new Dell computer with Windows Vista and I am trying to put iTunes on it. I can install it fine from the original CD, and then I am prompted to update it to 7.2. After updating, this is the message that I get: Windows-No Disk, Exception
-
How do I change the color of text in iTunes store?
I can't read the prices!! This is in the just-released iTunes version 11.0.
-
TO display pop_up on selection screen And chosse that field in 'SELECT' sta
Hello, I want a pop up on selection screen when user clicks the push button on selection screen pop up should come on selection screen and display the all field of YTLEA table. when user checks few or all field from pop up then data for that field is
-
I just can't turn off Genius. I have signed out of the store, I do not use Match so it is not turned on. Turn Off Genius is grayed out.
-
Multithreading and PreparedStatement
I am debugging a problem with the interaction between Hibernate and our JDBC driver. Hibernate uses a PreparedStatement to insert values into the database. When it inserts a Timestamp value into the database, it sets the value into the Timestamp obje