Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello!
I have a table containing the records of hiring and firing of employees:
date | id_shop | Position | id_Employee | accepted_or_dismissed
Q: how to count how many people are employed at the store in positions on a certain day? I mean: 10.11.2012 in the store "A" employed 10 salespeople, 2 admin, 4 cashier.
Attaches table. I will be grateful to any advice. Thanks!
Сотрудники:
LOAD id_Сотрудника,
ФИО,
Должность,
id_Организации,
AutoNumber(id_Склада, 'Склады') as id_Склада,
ДатаПриема,
if(isNull(ДатаУвольнения),Date(Date#(today(), 'DD.MM.YYYY'), 'DD.MM.YYYY'),ДатаУвольнения) as ДатаУвольнения,
ИзмДолжности,
Перевод,
Key
FROM
КадровыеПриказы.qvd
(qvd);
left join (Сотрудники)
IntervalMatch (Дата)
LOAD
ДатаПриема,
ДатаУвольнения
RESIDENT Сотрудники
;
Check this qvw
Thanks, but I need to know the number of employees in the store every day of the calendar, starting from 1.01.2011
Check this
Counting is performed incorrectly. The method described here Подсчет сотрудников имея записи о приеме и увольнении is more like the truth. Also emerged that I did not take into account "transfers" from one store to another store (if two stores owned one organization). I will remade the original table. But anyway thanks!
Сотрудники:
LOAD id_Сотрудника,
ФИО,
Должность,
id_Организации,
AutoNumber(id_Склада, 'Склады') as id_Склада,
ДатаПриема,
if(isNull(ДатаУвольнения),Date(Date#(today(), 'DD.MM.YYYY'), 'DD.MM.YYYY'),ДатаУвольнения) as ДатаУвольнения,
ИзмДолжности,
Перевод,
Key
FROM
КадровыеПриказы.qvd
(qvd);
left join (Сотрудники)
IntervalMatch (Дата)
LOAD
ДатаПриема,
ДатаУвольнения
RESIDENT Сотрудники
;