This almost works. The SDM_Field contains character data. This should not show all nulls.
Suggestions appreciated.
Thanks,
Brooks
SELECT [DESTFLD]
,[AFS] as AFS,[CLCS] as CLCS,[CPI] as CPI,[ForeignOfficeDeposits] as ForeignOfficeDeposits,[HEQ] as HEQ
,[ILN] as ILN,[INVSEC] as InvSec,[Mansec_Swaps] as Mansec_Swaps,[Manual] as Manualx,[Manual_SBO] as Manual_SBO
,[QRMLiab] as QRMLiab,[TDA] as TDA
FROM
(select [DESTFLD],[SDM_System],[SDM_Field]
from [Reporting].[dbo].[vw_QRM_Transformations_Staging]) ps
pivot
(max( [SDM_field])
for [SDM_System]
in
([AFS],[CLCS],[CPI],[ForeignOfficeDeposits],[HEQ]
,[ILN],[INVSEC] ,[Mansec_Swaps] ,[Manual],[Manual_SBO]
,[QRMLiab],[TDA])
) as pvt
DESTFLD AFS CLCS CPI ForeignOfficeDeposits HEQ ILN InvSec Mansec_Swaps Manualx Manual_SBO QRMLiab TDA
AMORT_DATE NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
AMORT_TYPE NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
AVGBAL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
AVGBALANCE NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
BALLN_DATD NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
BOOK_VALUE NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
Suggestions appreciated.
Thanks,
Brooks
SELECT [DESTFLD]
,[AFS] as AFS,[CLCS] as CLCS,[CPI] as CPI,[ForeignOfficeDeposits] as ForeignOfficeDeposits,[HEQ] as HEQ
,[ILN] as ILN,[INVSEC] as InvSec,[Mansec_Swaps] as Mansec_Swaps,[Manual] as Manualx,[Manual_SBO] as Manual_SBO
,[QRMLiab] as QRMLiab,[TDA] as TDA
FROM
(select [DESTFLD],[SDM_System],[SDM_Field]
from [Reporting].[dbo].[vw_QRM_Transformations_Staging]) ps
pivot
(max( [SDM_field])
for [SDM_System]
in
([AFS],[CLCS],[CPI],[ForeignOfficeDeposits],[HEQ]
,[ILN],[INVSEC] ,[Mansec_Swaps] ,[Manual],[Manual_SBO]
,[QRMLiab],[TDA])
) as pvt
DESTFLD AFS CLCS CPI ForeignOfficeDeposits HEQ ILN InvSec Mansec_Swaps Manualx Manual_SBO QRMLiab TDA
AMORT_DATE NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
AMORT_TYPE NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
AVGBAL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
AVGBALANCE NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
BALLN_DATD NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
BOOK_VALUE NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL