Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 2.65 KB | None | 0 0
  1.  
  2. select    
  3.  
  4.       igpCapUE.[NombreSMMGP]
  5.       ,igpCapUE.[UnidadEjecutora]
  6.       ,1 as IGPFull
  7.      ,(select top 1 sum([Cumpl_Físico_Calculado_Formateado])   over() /count(*)  over()
  8.             from  [WK12DGPETL01].[Indicadores_ITEEP].[dbo].VW_UnidadEjecutoraProgramacionCumplimientoFormateado
  9.                  where cod_ue =  igpCapUE.CodigoUnidadEjecutora COLLATE SQL_Latin1_General_CP1_CI_AS
  10.                  and Cod_Subcapitulo = '01'
  11.                  and  Cod_Capitulo = '0101'
  12.                  and trimestre = 3
  13.                 and cod_periodo = '2018'
  14.        
  15.             ) as IGP01Eficacia
  16.      ,1 as IGP02CorrectaPubPresu
  17.           from
  18.                 (SELECT
  19.                       [Id] as SubIndicadoresCorrectasPublicacionesPresupuestariaId
  20.                       , IndiceGestionPresupuestariaId
  21.                       ,[FechaEvaluacion]
  22.                       ,[Comentarios]
  23.                       ,[CompletadoPorAnalistaNumeroPonche]
  24.                       ,[PublicaPresupuestoEnPlazoEstablecido]
  25.                       ,[UtilizaCorrectamenteClasificadoresPresupuestarios]
  26.                       ,[PresupuestoPublicoCoincideConSIGEF]
  27.                       ,[PublicaEjecucionEnPlazoEstablecido]
  28.                       ,[UtilizaCorrectamenteClasificadoresPresupuestariosS0205]
  29.                       ,[EjecucionPublicadaCoincideConSIGEF]
  30.                       ,[PuntuacionGenerada]
  31.                       ,3  as trimestre
  32.                       ,'2018'  as periodo
  33.  
  34.          
  35.                   FROM [ColaboracionInterna].[dbo].[SubIndicadoresCorrectasPublicacionesPresupuestarias]  
  36.                     where [IsDeleted] = 0
  37.        
  38.                   ) as SubIgp
  39.  
  40.                   join [dbo].VW_IGPWithCapAndUnidadEjecutora as igpCapUE
  41.                   on igpCapUE.[IndiceGestionPresupuestariaId] = SubIgp.IndiceGestionPresupuestariaId
  42.  
  43.                   --  join [dbo].IndicesGestionesPresupuestarias as igp
  44. --  on igp.id = igpCap.IndiceGestionPresupuestariaId
  45.  
  46.               where FechaEvaluacion between
  47.                     case
  48.                          when trimestre = 1 then  periodo + '-01-01'
  49.                          when trimestre = 2 then  periodo + '-04-01'
  50.                          when trimestre = 3 then  periodo + '-07-01'
  51.                          when trimestre = 4 then  periodo + '-10-01'
  52.                     end
  53.                 and     case
  54.                          when trimestre = 1 then  periodo + '-03-31'
  55.                          when trimestre = 2 then  periodo + '-06-30'
  56.                          when trimestre = 3 then  periodo + '-09-30'
  57.                          when trimestre = 4 then  periodo + '-12-31'
  58.                     end
  59.             and CompletadoPorAnalistaNumeroPonche != 0
  60.  
  61.             group by SubIgp.IndiceGestionPresupuestariaId,
  62.             igpCapUE.[IndiceGestionPresupuestariaId]
  63.               ,igpCapUE.[IGPAnalistasCapSubCapUnidadesEjecutoraId]
  64.               ,igpCapUE.[AnalistaCapSubCapUnidadEjecutoraId]
  65.               ,igpCapUE.[NombreSMMGP]
  66.               ,igpCapUE.[NormadoDIGEIG]
  67.               ,igpCapUE.[TieneProductosSIGEF]
  68.               ,igpCapUE.[TienePortalTransparencia]
  69.               ,igpCapUE.[EjecutaSIGEF]
  70.               ,igpCapUE.[CodigoCapitulo]
  71.               ,igpCapUE.[CodigoSubCapitulo]
  72.               ,igpCapUE.[CodigoUnidadEjecutora]
  73.               ,igpCapUE.[UnidadEjecutora]
  74.               ,SubIgp.periodo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement