Hello -
Have a SQL where a PIVOT function creates the following:
test_number SHIFT1 SHIFT2 SHIFT3
9000 4 3 0
9002 10 8 0
9008 2 2 0
9010 2 0 0
I would like to add a TOTAL colum and Row where I get totals by SHIFT and by Test, therefore test 9000 would have a total of 7 and SHIFT1 would have a total of 18. Is this possible? Moreover, eventually I would like to calculate % of test-totals - the calculation would be equal to: total number by test_number divided by total number for all tests (i.e. for test number 9000 the value would be 7/31 = 22.58%. So the table would look like this:
test_number SHIFT1 SHIFT2 SHIFT3 TOTAL % of Test-Totals
9000 4 3 0 7 22.58%
9002 10 8 0 18 58.06%
9008 2 2 0 4 12.90%
9010 2 0 0 2 6.45%
TOTAL 18 13 0 31 100.00%
THANK YOU FOR ANY ASSISTANCE YOU MAY BE ABLE TO GIVE
Have a SQL where a PIVOT function creates the following:
test_number SHIFT1 SHIFT2 SHIFT3
9000 4 3 0
9002 10 8 0
9008 2 2 0
9010 2 0 0
I would like to add a TOTAL colum and Row where I get totals by SHIFT and by Test, therefore test 9000 would have a total of 7 and SHIFT1 would have a total of 18. Is this possible? Moreover, eventually I would like to calculate % of test-totals - the calculation would be equal to: total number by test_number divided by total number for all tests (i.e. for test number 9000 the value would be 7/31 = 22.58%. So the table would look like this:
test_number SHIFT1 SHIFT2 SHIFT3 TOTAL % of Test-Totals
9000 4 3 0 7 22.58%
9002 10 8 0 18 58.06%
9008 2 2 0 4 12.90%
9010 2 0 0 2 6.45%
TOTAL 18 13 0 31 100.00%
THANK YOU FOR ANY ASSISTANCE YOU MAY BE ABLE TO GIVE