Indicadores de HR Core

Cantidad de empleados activos a hoy (1)

Este indicador trae como resultado la cantidad de empleados que hay activos al día de hoy.

Query - SQL

select count(*)
from empleado
where empest = -1

Empleados con Licencias a hoy (2)

Este indicador trae como resultado la cantidad de empleados que tienen licencias hasta el día de hoy.

Query - SQL

select count(*)
from emp_lic
where elfechadesde <= convert(datetime, convert(int, getdate())) and elfechahasta >= convert(datetime, convert(int, getdate()))

Empleados de Vacaciones a Hoy (3)

Este indicador trae como resultado la cantidad de empleados que se encuentran de vacaciones al día de hoy.

Query - SQL

select count(*)
from emp_lic
where elfechadesde <= convert(datetime, convert(int, getdate())) and elfechahasta >= convert(datetime, convert(int, getdate())) and tdnro = 2

Empleados en licencia por accidente (ARG) (4)

Este indicador trae como resultado la cantidad de empleados que se encuentran de licencia por accidente al día de hoy.

Query - SQL

select count(*)
from emp_lic
where elfechadesde <= convert(datetime, convert(int, getdate())) and elfechahasta >= convert(datetime, convert(int, getdate())) and tdnro in (13,14)

Altas en los últimos 7 días (5)

Este indicador trae como resultado la cantidad de altas que se registraron en los últimos 7 días.

Query - SQL

select count(*)
from fases
where (altfec >= convert(datetime, convert(int, getdate())) - 7) and (altfec <= convert(datetime, convert(int, getdate())))

Bajas en los últimos 7 días (6)

Este indicador trae como resultado la cantidad de bajas que se registraron en los últimos 7 días.

Query - SQL

select count(*)
from fases
where (bajfec >= convert(datetime, convert(int, getdate())) - 7) and (bajfec <= convert(datetime, convert(int, getdate())))

Altas en el mes actual (7)

Este indicador trae como resultado la cantidad de altas que se registraron en el mes en curso.

Query - SQL

select count(*)
from fases
where month(altfec) = month(getdate()) and year(altfec) = year(getdate())

Bajas en el mes actual (8)

Este indicador trae como resultado la cantidad de bajas que se registraron en el mes en curso.

Query - SQL

select count(*)
from fases
where month(bajfec) = month(getdate()) and year(bajfec) = year(getdate())

Empleados activos en la empresa (9)

Este indicador trae como resultado la cantidad de empleados activos en una empresa determinada.

Parámetro utilizado: 3 – Empresa.

Query - SQL

select count(*)
from his_estructura
where estrnro = Empresa and (htetdesde <= convert(datetime, convert(int, getdate()))) and ((convert(datetime, convert(int, getdate())) < htethasta) or (htethasta is null))

Empleados con contrato efectivo (10)

Este indicador trae como resultado la cantidad de empleados que tienen un contrato efectivo.

Parámetro utilizado: 4 – Contrato Efectivo.

Query - SQL

select count(*)
from his_estructura
where estrnro = Contrato Efectivo and (htetdesde <= convert(datetime, convert(int, getdate()))) and ((convert(datetime, convert(int, getdate())) <= htethasta) or (htethasta is null))

Empleados con contrato de Prueba (11)

Parámetro 5 – Periodo Prueba.

Query - SQL

select count(*)
from his_estructura
where estrnro = Periodo Prueba and (htetdesde <= convert(datetime, convert(int, getdate()))) and ((convert(datetime, convert(int, getdate())) <= htethasta) or (htethasta is null))

Pasantes (12)

Este indicador trae como resultado la cantidad de empleados que se encuentran realizando una pasantía.

Parámetro utilizado: 6 – Pasantia.

Query - SQL

select count(*)
from his_estructura
where estrnro = Pasantia and (htetdesde <= convert(datetime, convert(int, getdate()))) and ((convert(datetime, convert(int, getdate())) <= htethasta) or (htethasta is null))

Empleados Activos Hombres (13)

Este indicador trae como resultado la cantidad de empleados de sexo masculino que se encuentran activos.

Query - SQL

select count(*)
from empleado inner join tercero on tercero.ternro = empleado.ternro
where empest = -1 and tersex = -1

Empleados Activos Mujeres (14)

Este indicador trae como resultado la cantidad de empleados de sexo femenino que se encuentran activos.

Query - SQL

select count(*)
from empleado inner join tercero on tercero.ternro = empleado.ternro
where empest = -1 and tersex = 0

Empleados de mas de 65 años (15)

Este indicador trae como resultado la cantidad de empleados mayores de 65 años que se encuentran activos.

Query - SQL

select count(*)
from empleado inner join tercero on tercero.ternro = empleado.ternro
where empest = -1 and convert(int,getdate() - terfecnac)/365 >= 65

Cantidad de Entregas de Cascos Año (53)

Este indicador trae como resultado la cantidad de entregas de cascos realizadas en el año.

Parámetro utilizado: 12 – Casco.

Query - SQL

select count(*)
from sodetentrega
where year(dentfecent) = year(getdate()) and elemnro = Casco  

Cantidad de Entregas de Uniformes Año (54)

Este indicador trae como resultado la cantidad de entregas de uniformes realizadas en el año.

Parámetro utilizado: 13 – Uniforme.

Query - SQL

select count(*)
from sodetentrega
where year(dentfecent) = year(getdate()) and elemnro = Uniforme

Cantidad de Autos Entregados (55)

Este indicador trae como resultado la cantidad de autos entregados.

Parámetro utilizado: 14 – Auto.

Query - SQL

select count(*)
from bienesuso
where year(bieusofecent) = year(getdate()) and tipbienro = Auto

Cantidad de Celulares Entregados (56)

Este indicador trae como resultado la cantidad de celulares entregados.

Parámetro utilizado: 15 – Celular.

Query - SQL

select count(*)
from bienesuso
where year(bieusofecent) = year(getdate()) and tipbienro = Celular

Cantidad emp activos a hoy sin empl de Agencia (73)

Este indicador trae como resultado la cantidad de empleados activos (que no sean empleados de agencia) hasta hoy.

Query - SQL

select count(*)
from empleado
where empest = -1 and empleado.ternro not in (select ternro from his_estructura agencia where agencia.tenro = 28 and agencia.htethasta is null)

Altas en el mes actual sin empleados de agencia (74)

Este indicador trae como resultado la cantidad de altas de empleados (que no sean empleados de agencia) que se produjeron en el mes actual.

Query - SQL

select count(*)
from fases inner join empleado on empleado.ternro = fases.empleado
where month(altfec) = month(getdate()) and year(altfec) = year(getdate()) and empleado.ternro not in (select ternro from his_estructura agencia where agencia.tenro = 28 and gencia.htethasta is null)

Bajas en el mes actual sin empleados de agencia (75)

Este indicador trae como resultado la cantidad de bajas de empleados (que no sean empleados de agencia) que se produjeron en el mes actual.

Query - SQL

select count(*)
from fases inner join empleado on empleado.ternro = fases.empleado
where month(bajfec) = month(getdate()) and year(bajfec) = year(getdate()) and empleado.ternro not in (select ternro from his_estructura agencia where agencia.tenro = 28 and gencia.htethasta is null)

Empleados por debajo de la banda salarial (79)

Este indicador trae como resultado la cantidad de empleados que se encuentran por debajo de la banda salarial.

Query - SQL

select count(acc.ternro)
from acu_mes acc inner join empleado on empleado.ternro = acc.ternro and ammes = (select max(ac.ammes) from acu_mes ac where empleado.ternro = ac.ternro and acunro = 6 and ac.amanio = acc.amanio) and amanio = (select max(ac2.amanio) from acu_mes ac2 where ternro = empleado.ternro and acunro = 6) where acc.ternro = empleado.ternro and acunro = 6 and acc.ammonto < (case when empleado.empzona = 'A' then (select bszonaa from banda_salarial where banda_salarial.granro = empleado.granro and bsinterna = -1) when empleado.empzona = 'AB'  then (select bszonaab from banda_salarial where banda_salarial.granro = empleado.granro and bsinterna = -1) when empleado.empzona = 'B' then (select bszonab from banda_salarial where banda_salarial.granro = empleado.granro and bsinterna = -1) when empleado.empzona = 'BC' then (select bszonabc from banda_salarial where banda_salarial.granro = empleado.granro and bsinterna = -1) when empleado.empzona = 'C' then (select bszonac from banda_salarial where banda_salarial.granro = empleado.granro and bsinterna = -1) else 0 end)

Empleados por encima de la banda salarial (80)

Este indicador trae como resultado la cantidad de empleados que se encuentran por encima de la banda salarial.

Query - SQL

select count(acc.ternro)
from acu_mes acc inner join empleado on empleado.ternro = acc.ternro and ammes = (select max(ac.ammes) from acu_mes ac where empleado.ternro = ac.ternro and acunro = 6 and ac.amanio = acc.amanio) and amanio = (select max(ac2.amanio) from acu_mes ac2 where ternro = empleado.ternro and acunro = 6) where acc.ternro = empleado.ternro and acunro = 6 and acc.ammonto > (case when empleado.empzona = 'A'  then (select bszonaa from banda_salarial where banda_salarial.granro = empleado.granro and bsinterna = -1) when empleado.empzona = 'AB'  then (select bszonaab from banda_salarial where banda_salarial.granro = empleado.granro and bsinterna = -1) when empleado.empzona = 'B' then (select bszonab from banda_salarial where banda_salarial.granro = empleado.granro and bsinterna = -1) when empleado.empzona = 'BC' then (select bszonabc from banda_salarial where banda_salarial.granro = empleado.granro and bsinterna = -1) when empleado.empzona = 'C' then (select bszonac from banda_salarial where banda_salarial.granro = empleado.granro and bsinterna = -1) else 0 end)

Porcentaje de Empleados Baby Boomers (81)

Este indicador trae como resultado el porcentaje de todos los empleados activos nacidos entre 1945 y 1964.

Query - SQL

select ((count(empleg)*100) / (select count(empleg) from empleado where empest=-1)) Porcentaje
from empleado inner join tercero on empleado.ternro = tercero.ternro
where terfecnac between '01/01/1945' and '31/12/1964' and empest=-1

Porcentaje de Empleados Generación X (82)

Este indicador trae el porcentaje de todos los empleados activos nacidos entre 1964 y 1982.

Query - SQL

select ((count(empleg)*cast(100 as numeric(10,4))) / (select count(empleg) from empleado where empest=-1)) Porcentaje
from empleado inner join tercero on empleado.ternro = tercero.ternro
where terfecnac between '01/01/1964' and '31/12/1981' and empest=-1

Porcentaje de Empleados Generación Y (83)

Este indicador trae el porcentaje de todos los empleados activos nacidos entre 1982 y 2000.

Query - SQL

select ((count(empleg)*cast(100 as numeric(10,4))) / (select count(empleg) from empleado where empest=-1)) Porcentaje
from empleado inner join tercero on empleado.ternro = tercero.ternro
where terfecnac between '01/01/1982' and '31/12/2000' and empest=-1

Porcentaje de Rotación (91)

Este indicador trae el porcentaje de todos los empleados activos nacidos entre 1982 y 2000.

Query - SQL

select sum(altas)*cast(100 as numeric(10,4)) / (select sum(total)/2 from (select (count(*)) total from fases where (year(altfec) < year(getdate())) and (((year(bajfec) = year(getdate())) or ((month(bajfec)>=2) and year(bajfec)=year(getdate()))) or bajfec is null) union select(count(*)) total from fases where(year(altfec) year(getdate())) or ((month(bajfec)=12) and year(bajfec)=year(getdate())) or bajfec is null)) total) porcentaje from (select count(altfec) altas from fases where year(altfec)=year(getdate()) union all select - count(bajfec) from fases where year(bajfec)=year(getdate())) resta

Porcen. de Rot. primeros 90 Días de Servicio (92)

Este indicador trae el porcentaje de todos los empleados activos nacidos entre 1982 y 2000.

Query - SQL

select count(distinct ternro)*cast(100 as numeric(10,4))/ (select sum(total)/2 from (select (count(*)) total from fases where (year(altfec) < year(getdate())) and (((year(bajfec) = year(getdate())) or ((month(bajfec)>=2) and year(bajfec)=year(getdate()))) or bajfec is null) union select (count(*)) total from fases where (year(altfec) year(getdate())) or ((month(bajfec)=12) and year(bajfec)=year(getdate())) or bajfec is null)) total) porcentaje
from fases f inner join empleado e on f.empleado = e.ternro
where real = -1 and datediff(day,altfec,bajfec)<=90

Porcentaje de Rotación al Primer Año de Servicio (93)

Este indicador trae el porcentaje de todos los empleados activos nacidos entre 1982 y 2000.

Query - SQL

select count(*)*cast(100 as numeric(10,4))/ (select sum(total)/2 from (select (count(*)) total from fases where (year(altfec) < year(getdate())) and (((year(bajfec) = year(getdate())) or ((month(bajfec)>=2) and year(bajfec)=year(getdate()))) or bajfec is null) union select (count(*)) total from fases where (year(altfec) year(getdate())) or ((month(bajfec)=12) and year(bajfec) = year(getdate())) or bajfec is null)) total) porcentaje from fases f inner join empleado e on f.empleado = e.ternro where real = -1 and datediff(day,altfec,bajfec)<=365

Porcentaje de Desvinculación Voluntaria (94)

Parámetro utilizado: 20 – Causa Voluntaria.

Query - SQL

select count(*) * cast(100 as numeric(10,4)) / (select sum(total)/2 from (select (count(*)) total from fases where (year(altfec) < year(getdate())) and (((year(bajfec) = year(getdate())) or ((month(bajfec)>=2) and year(bajfec)=year(getdate()))) or bajfec is null) union select (count(*)) total from fases where (year(altfec) year(getdate())) or ((month(bajfec)=12) and year(bajfec) = year(getdate())) or bajfec is null)) total) porcentaje from fases f inner join causa c on f.caunro = c.caunro where (year(f.bajfec) = year(getdate())) and c.caunro in (Causa Voluntaria)

Porcentaje de Desvinculación Involuntaria (95)

Parámetro utilizado: 20 – Causa Voluntaria.

Query - SQL

select count(*) * cast(100 as numeric(10,4)) / (select sum(total)/2  from (select (count(*)) total from fases where (year(altfec) < year(getdate())) and (((year(bajfec) = year(getdate())) or ((month(bajfec)>=2) and year(bajfec)=year(getdate()))) or bajfec is null) union select (count(*)) total from fases where (year(altfec)< year(getdate())) or (year(altfec) = year(getdate()) and month(altfec)<=11) and ((year(bajfec) > year(getdate())) or ((month(bajfec)=12) and year(bajfec) = year(getdate())) or bajfec is null)) total) porcentaje from fases f inner join causa c on f.caunro=c.caunro where (year(f.bajfec) = year(getdate())) and c.caunro not in (Causa Voluntaria)

Porcen. de Desvinc. Voluntaria de Baby Boomers (96)

Parámetro utilizado: 20 – Causa Voluntaria.

Query - SQL

select count(*) * cast(100 as numeric(10,4))/  (select sum(total)/2  from (select (count(*)) total from fases  where (year(altfec) < year(getdate()))  and (((year(bajfec) = year(getdate())) or ((month(bajfec)>=2) and year(bajfec) = year(getdate()))) or bajfec is null) union select (count(*)) total from fases where (year(altfec) < year(getdate())) or (year(altfec)=year(getdate()) and month(altfec) <= 11) and ((year(bajfec) > year(getdate())) or ((month(bajfec)=12) and year(bajfec) = year(getdate())) or bajfec is null)) total) porcentaje  from fases f  inner join causa c on f.caunro = c.caunro inner join empleado e on e.ternro = f.empleado inner join tercero t on e.ternro = t.ternro where (year(f.bajfec) = year(getdate())) and c.caunro in (Causa Voluntaria) and  t.terfecnac between '01/01/1945' and '31/12/1963'

Porcen. de Desvinc. Voluntaria de Generación X (97)

Parámetro utilizado: 20 – Causa Voluntaria.

Query - SQL

select count(*) * cast(100 as numeric(10,4))/  (select sum(total)/2  from (select (count(*)) total from fases  where (year(altfec) < year(getdate())) and (((year(bajfec) = year(getdate())) or ((month(bajfec)>=2) and year(bajfec)=year(getdate()))) or bajfec is null) union select (count(*)) total from fases  where (year(altfec) < year(getdate())) or (year(altfec) = year(getdate()) and month(altfec)<=11)  and ((year(bajfec) > year(getdate())) or ((month(bajfec)=12) and year(bajfec)=year(getdate())) or bajfec is null)) total) porcentaje  from fases f  inner join causa c on f.caunro=c.caunro inner join empleado e on e.ternro=f.empleado inner join tercero t on e.ternro = t.ternro where (year(f.bajfec) = year(getdate())) and c.caunro in (Causa Voluntaria)  and  t.terfecnac between '01/01/1964' and '31/12/1981'  

Porcen. de Desvinc. Voluntaria de Generación Y (98)

Parámetro utilizado: 20 – Causa Voluntaria.

Query - SQL

select count(*) * cast(100 as numeric(10,4))/  (select sum(total)/2  from (select (count(*)) total from fases  where (year(altfec) < year(getdate())) and (((year(bajfec) = year(getdate())) or ((month(bajfec)>=2) and year(bajfec) = year(getdate()))) or bajfec is null) union select (count(*)) total from fases  where (year(altfec) < year(getdate())) or (year(altfec) = year(getdate()) and month(altfec)<=11)  and ((year(bajfec) > year(getdate())) or ((month(bajfec)=12) and year(bajfec) = year(getdate())) or bajfec is null)) total) porcentaje from fases f  inner join causa c on f.caunro=c.caunro inner join empleado e on e.ternro = f.empleado inner join tercero t on e.ternro = t.ternro  where (year(f.bajfec) = year(getdate())) and c.caunro in (Causa Voluntaria)  and  t.terfecnac between '01/01/1983' and '31/12/2000'  

Rotación poblacional (101)

Query - SQL

select cast((select(select cast((select count(his_estructura.ternro)
from empleado inner join his_estructura on empleado.ternro = his_estructura.ternro and his_estructura.tenro = 10 and ((his_estructura.htetdesde >= (select convert(varchar(12), dateadd(month, -12, getdate()), 103)) and his_estructura.htetdesde <= (select convert(varchar(12), getdate(), 103)))) ) as decimal(10,2)) / (select cast((select count(*) from empleado inner join tercero on tercero.ternro = empleado.ternro
where empest = -1) as decimal(10,2)))) * 100) as decimal(10,2)) valor  

Rotación de mercado (102)

Query - SQL

select cast((select(select cast((select count(his_estructura.ternro) from empleado inner join his_estructura on empleado.ternro = his_estructura.ternro and his_estructura.tenro = 10 and his_estructura.estrnro in(1640,1743) and ((his_estructura.htetdesde >= (select convert(varchar(12), dateadd(month, -12, getdate()), 103)) and his_estructura.htetdesde <= (select convert(varchar(12), getdate(), 103))))) as decimal(10,2)) / (select cast((select count(*) from empleado inner join tercero on tercero.ternro = empleado.ternro where empest = -1) as decimal(10,2)))) * 100) as decimal(10,2)) valor

Rotación no deseada (103)

Query - SQL

select cast((select (select cast((select count(his_estructura.ternro) from empleado inner join his_estructura on empleado.ternro = his_estructura.ternro and his_estructura.tenro = 10 and his_estructura.estrnro =1640 and ((his_estructura.htetdesde >= (select convert(varchar(12), dateadd(month, -12, getdate()), 103))  and his_estructura.htetdesde <= (select convert(varchar(12), getdate(), 103))))) as decimal(10,2)) / (select cast((select count(*) from empleado inner join tercero on tercero.ternro = empleado.ternro where empest = -1) as decimal(10,2))) ) * 100) as decimal(10,2)) valor

Cant. personas a cargo (116)

Se calcula en función a los empleados que le reportan.

Query - SQL

select z.ternro, isnull((select count(e.ternro) cant from empleado E inner join tercero T on T.ternro = E.ternro where E.empest = -1 and E.empreporta in (select ternro from empleado e1 where 1.empleg = z.empleg)), 0) cant from (select empleg, empleado.ternro from empleado inner join tercero Templ on Templ.ternro = empleado.ternro where empleado.empest = -1 ) z order by z.ternro
Ir arriba ↑