Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
vtatarnikov
Creator
Creator

Count of employed staff

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!

1 Solution

Accepted Solutions
vtatarnikov
Creator
Creator
Author

Сотрудники:

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 Сотрудники

;

View solution in original post

5 Replies
anbu1984
Master III
Master III

Check this qvw

vtatarnikov
Creator
Creator
Author

Thanks, but I need to know the number of employees in the store every day of the calendar, starting from 1.01.2011

anbu1984
Master III
Master III

Check this

vtatarnikov
Creator
Creator
Author

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!

vtatarnikov
Creator
Creator
Author

Сотрудники:

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 Сотрудники

;