Creo que lo tengo (para quien le sirva)
Código SQL:
Ver originalSELECT [Grupo], CASE WHEN SUM(plazo1) IS NULL THEN 0 ELSE SUM(plazo1) END AS '1 MES', CASE WHEN SUM(plazo2) IS NULL THEN 0 ELSE SUM(plazo2) END AS '3 MESES', CASE WHEN SUM(plazo3) IS NULL THEN 0 ELSE SUM(plazo3) END AS '6 MESES',
SUM(isnull(plazo1,0) + isnull(plazo2,0) + isnull(plazo3,0)) AS TOTAL
FROM (SELECT CASE WHEN plazo='Plazo 1' THEN SUM(Nominal) END AS plazo1,
CASE WHEN plazo='Plazo 2' THEN SUM(Nominal) END AS plazo2,
CASE WHEN plazo='Plazo 3' THEN SUM(Nominal) END AS plazo3,[Grupo], plazo
FROM(SELECT [Grupo], SUM([Nominal]) AS Nominal,
CASE WHEN [Plazo] = '1M' THEN 'Plazo 1'
WHEN [Plazo] = '3M' THEN 'Plazo 2'
WHEN [Plazo] = '6M' THEN 'Plazo 3' END AS Plazo
FROM [TABLA]
GROUP BY [Grupo], Plazo) AS t1 GROUP BY [Grupo Inversor], plazo) AS t2 GROUP BY [Grupo]
Muchas gracias Libras por la ayuda prestada, como siempre.
Saludos!