Please see solution:
_
_
USE[cpqaAnswers]
GO
CREATE TABLE [cpqa].[tbl_OZ_notevenPivot](
[Date][datetime],
[Branch1_Qty][int],
[Branch1_Value][bigint],
[Branch2_Qty][int],
[Branch2_Value][bigint],
[Branch3_Qty][int],
[Branch3_Value][bigint]
)
INSERT INTO [cpqa].[tbl_OZ_notevenPivot]
VALUES('15-Nov-13',5,5000,5,5000,5,5000),
('16-Nov-13',5,5000,5,5000,5,5000),
('17-Nov-13',5,5000,5,5000,5,5000),
('18-Nov-13',5,5000,5,5000,5,5000),
('19-Nov-13',5,5000,5,5000,5,5000)
First as-is query, given suspected data:
_
_
SELECT * FROM [cpqa].[tbl_OZ_notevenPivot]
Date Branch1_Qty Branch1_Value Branch2_Qty Branch2_Value Branch3_Qty Branch3_Value
2013-11-15 00:00:00.000 5 5000 5 5000 5 5000
2013-11-16 00:00:00.000 5 5000 5 5000 5 5000
2013-11-17 00:00:00.000 5 5000 5 5000 5 5000
2013-11-18 00:00:00.000 5 5000 5 5000 5 5000
2013-11-19 00:00:00.000 5 5000 5 5000 5 5000
Then suspect answer data in table form:
_
_
SELECT [Date],[Branch1_Qty],[Branch1_Value],[Branch2_Qty],[Branch2_Value],[Branch3_Qty],[Branch3_Value], Branch1_Qty + Branch2_Qty + Branch3_Qty AS [Total_Qty], Branch1_Value + Branch2_Value + Branch3_Value AS [Total_Value] FROM [cpqa].[tbl_OZ_notevenPivot]
Date Branch1_Qty Branch1_Value Branch2_Qty Branch2_Value Branch3_Qty Branch3_Value Total_Qty Total_Value
2013-11-15 00:00:00.000 5 5000 5 5000 5 5000 15 15000
2013-11-16 00:00:00.000 5 5000 5 5000 5 5000 15 15000
2013-11-17 00:00:00.000 5 5000 5 5000 5 5000 15 15000
2013-11-18 00:00:00.000 5 5000 5 5000 5 5000 15 15000
2013-11-19 00:00:00.000 5 5000 5 5000 5 5000 15 15000