Allan Talver
09/24/2021, 2:21 PMAllan Talver
09/24/2021, 2:21 PMAllan Talver
09/24/2021, 2:24 PMAllan Talver
09/24/2021, 2:24 PMAllan Talver
09/24/2021, 2:25 PMAllan Talver
09/24/2021, 2:28 PMAllan Talver
09/24/2021, 2:28 PMJakub Sterba
09/24/2021, 4:43 PMEmployee WD / Company WD
If there is no record for employee in Jira dataset the metric Employee for that date has probably NULL value. The result of division is:
• 1/1=1
• 0/1=0
• null/1=null
I suggest to wrap Employee WD by IFNULL function:
IFNULL(Employee WD,0) / Company WD
Query engine will interpret null value (missing data) as 0 and result of IFNULL(null,0)/1 should be 0.
I suggest not to use Records of Jira in metric expression of Company WD. So that it returns value even for days for which none record exists. I suggest something like:
select sum(select ifnull(sum(Availability -Unpaid (Absence)/8),0)/sum(Workday) by Username, Date(Work Date))
Allan Talver
09/24/2021, 4:48 PMAllan Talver
09/24/2021, 4:51 PMJakub Sterba
09/24/2021, 4:51 PMJakub Sterba
09/24/2021, 5:15 PMselect count(Username) where
(select
(select sum(Availability - Unpaid (Absence)/8 ))
/
(select max(select (select sum(Workday) by Company) by Records of Jira))
by Username)=1
Jakub Sterba
09/24/2021, 5:16 PMAllan Talver
09/24/2021, 5:18 PMJakub Sterba
09/24/2021, 5:18 PMJakub Sterba
09/24/2021, 5:20 PMJakub Sterba
09/24/2021, 5:22 PMAllan Talver
09/24/2021, 5:24 PMAllan Talver
09/24/2021, 5:25 PMJakub Sterba
09/24/2021, 5:59 PMselect sum(select FTE_defined_above by Company)
User would be not counted as FTE if the user worked few days for one company and rest of the month for another even if he worked in all the days.Allan Talver
09/24/2021, 7:45 PMAllan Talver
09/30/2021, 1:27 PMJakub Sterba
09/30/2021, 1:34 PMselect count(Username) where
(select
(select sum(Availability - Unpaid (Absence)/8 ))
/
(select max(select (select sum(Workday) by Company) by Records of Jira))
by Username)=1
Jakub Sterba
09/30/2021, 1:36 PMselect (select sum(Workday) by Company) by Records of Jira))
shall lift number 20 from your example to all the records of the Jira dataset of the company regardless if a person worked 20 days or 10 days
Metric
select max(select (select sum(Workday) by Company) by Records of Jira))
should display value 20 for each Username from the company if you slice it by usernameJan Soubusta
10/01/2021, 6:57 AMAllan Talver
10/01/2021, 1:34 PMAllan Talver
10/01/2021, 1:35 PMAllan Talver
10/01/2021, 1:46 PMAllan Talver
10/01/2021, 1:54 PMAllan Talver
10/01/2021, 2:01 PMAllan Talver
10/01/2021, 2:10 PMJakub Sterba
10/02/2021, 1:09 AMselect sum(Availability)
Work days:
select sum(Workday) by all Username
FTE:
select Sum of Availability / Work days
The trick with “by all Username” will compute the sum(Workday) in context of insight (Company, Month/Year, Username) without the Username (Company,Month/Year) and result will be repeated for each value of Username. Without the “by all Username” the sum(Workday) cannot be broken down by Username. The value will be available in insight only for the months where exists relation between Username, Month, and Company.
See example with metrics below. Company A has working days Mon-Fri and Company B Sun-Sat.Jakub Sterba
10/02/2021, 1:10 AMJakub Sterba
10/02/2021, 1:23 AMselect max(select FTE by Company)
Jakub Sterba
10/02/2021, 7:32 AMselect count(Username) where (select FTE2 by Username)=1
Jakub Sterba
10/02/2021, 7:33 AMJakub Sterba
10/02/2021, 7:41 AMselect count(Username)
where (select max(select sum(Availability)/(select sum(Workday) by all Username) by Company) by Username)=1
Jakub Sterba
10/02/2021, 7:53 AMJakub Sterba
10/02/2021, 8:01 AMJakub Sterba
10/02/2021, 8:02 AMAllan Talver
10/04/2021, 8:53 AMAllan Talver
10/04/2021, 9:44 AMAllan Talver
10/04/2021, 9:46 AMJakub Sterba
10/04/2021, 9:48 AMselect sum(Workday) by all Username,Employee Status, ...
Allan Talver
10/04/2021, 9:54 AMJakub Sterba
10/04/2021, 9:56 AMJakub Sterba
10/04/2021, 9:56 AMselect sum(Workday) by all Username,all Employee Status, ...
Jakub Sterba
10/04/2021, 9:56 AMAllan Talver
10/04/2021, 9:56 AMAllan Talver
10/04/2021, 9:58 AMJakub Sterba
10/04/2021, 9:59 AMJakub Sterba
10/04/2021, 9:59 AMJakub Sterba
10/04/2021, 10:00 AMJakub Sterba
10/04/2021, 10:00 AMJakub Sterba
10/04/2021, 10:00 AMAllan Talver
10/04/2021, 10:00 AMJakub Sterba
10/04/2021, 10:02 AMJakub Sterba
10/04/2021, 10:03 AMJakub Sterba
10/04/2021, 10:36 AMBut I have one question about one pattern I see in your metrics. Could you explain why you decided to use the count function?I probably misunderstood requirement in the initial question:
What I am trying to do is to build a metric which eventually can be aggregated by company or even the whole group of companies, showing the number of full time employees (FTE) in a selected time periodSo I interpreted it that you need to count number of employees who work full time.
Allan Talver
10/04/2021, 10:37 AM