Hello,
Someone able to help me figure how this is calculated?
What fields in epicor make up this calculation?
Thanks
Aaron.
Hello,
Someone able to help me figure how this is calculated?
What fields in epicor make up this calculation?
Thanks
Aaron.
Typically I’ve seen the documentation specify that Emp Eff is (Estimated Hours / Actual Hours) * 100.
Estimates are not on this report and I’m not exactly sure how Epicor divides up JobOper Estimated hours when more than one operator works the job - maybe it’s based on a calculated rate and the completed qty clocked by the operator? And that is what is used to determine Emp Eff?
And this report is actually an average Eff % in the department, for the time range of the report.
Take a look at the system BAQ that feeds that report. In there you will find the calculated fields and you can see their syntax. I found this formula:
(case when BurdProdHrs = 0 then 0 else
(LaborDtl.EarnedHrs / BurdProdHrs) end)
The baq is called: zEmployeeEfficiency
Forgot about that @NateS - and it looks like my guess was correct to a certain extent.
Field Help on Job Tracker says Earned Hours is
“The amount of hours that it should have taken (based on standard) to produce the reported LaborQty. For Setup labor the Earned hours is the lessor of (Est.Setup - ActSetUp) or LaborDtl.BurdenHrs. Rework labor always has zero Earned hrs. Earned hours for production labor is calculated as (JobOper.EstProdHours / JobOper.RunQty) * LaborDtl.LaborQty”
Anyone able to tell me why the epiShape isn’t changing colour in the if statement?
private void edvV_TEAGLE_LabourDtlWthIndirect_1View_EpiViewNotification(EpiDataView view, EpiNotifyArgs args)
{
// ** Argument Properties and Uses **
// view.dataView[args.Row]["FieldName"]
// args.Row, args.Column, args.Sender, args.NotifyType
// NotifyType.Initialize, NotifyType.AddRow, NotifyType.DeleteRow, NotifyType.InitLastView, NotifyType.InitAndResetTreeNodes
if ((args.NotifyType == EpiTransaction.NotifyType.Initialize))
{
esEmp.EnabledCaption = 0.ToString("P2");
if ((args.Row > -1))
{
EpiUltraGrid grid = (EpiUltraGrid)csm.GetNativeControlReference("6d1c93f1-f9e7-4671-b904-bad1d9934862");
decimal a = 0;
decimal b = 0;
foreach(var row in grid.Rows)
{
a += Convert.ToDecimal(row.Cells["Calculated_EstMins"].Value);
b += Convert.ToDecimal(row.Cells["Calculated_ActMins"].Value);
}
if (div_result(a,b) >= 80)
{
esEmp.Status = ( Ice.Lib.Framework.StatusTypes )0;
esEmp.EnabledCaption = div_result(a,b).ToString("P2");
esEmp.Refresh();
} else if (div_result(a,b) <= 70)
{
esEmp.Status = ( Ice.Lib.Framework.StatusTypes )1;
esEmp.EnabledCaption = div_result(a,b).ToString("P2");
esEmp.Refresh();
}
else if (div_result(a,b) <= 40)
{
esEmp.Status = ( Ice.Lib.Framework.StatusTypes )2;
esEmp.EnabledCaption = div_result(a,b).ToString("P2");
esEmp.Refresh();
}
}
}
}
public decimal div_result(decimal a, decimal b)
{
if (a > 0 && b > 0)
{
return Math.Round(a/b, 2);
}
return 0;
}
I am not certain, but do you need an else before your return 0; ?
Made this change but still can’t seem to get the colours to change correctly based on the percentages… How annoying!
Something fishy is going on. Plop in a few message boxes to help debug your code. I would check the result of the function, and check when each if statement runs.
Dropped a few message boxes in the <= 40 runs twice then it stays on <=79 and doesn’t even hit >=80 if statement but the percentage is 162…
Definitely something weird. Try a messagebox that returns the true/false value of (div_result(a,b) >= 80), repeat for each of the other statements. If the condition is not acting as you expect then they could be some weird variable type issues going on. Maybe you can’t compare a decimal to an int. Try changing your statement to (div_result(a,b) >= 80.0)
Just spit-balling here…
I’ll let you know
Can I see your code with the debugging message boxes in place?
private void edvV_TEAGLE_LabourDtlWthIndirect_1View_EpiViewNotification(EpiDataView view, EpiNotifyArgs args) {
// ** Argument Properties and Uses **
// view.dataView[args.Row]["FieldName"]
// args.Row, args.Column, args.Sender, args.NotifyType
// NotifyType.Initialize, NotifyType.AddRow, NotifyType.DeleteRow, NotifyType.InitLastView, NotifyType.InitAndResetTreeNodes
if ((args.NotifyType == EpiTransaction.NotifyType.Initialize)) {
esEmp.EnabledCaption = 0. ToString("P2");
if ((args.Row > -1)) {
EpiUltraGrid grid = (EpiUltraGrid) csm.GetNativeControlReference("6d1c93f1-f9e7-4671-b904-bad1d9934862");
decimal a = 0;
decimal b = 0;
foreach(var row in grid.Rows) {
a += Convert.ToDecimal(row.Cells["Calculated_EstMins"].Value);
b += Convert.ToDecimal(row.Cells["Calculated_ActMins"].Value);
} if (div_result(a, b) <= 40m) {
esEmp.Status = (Ice.Lib.Framework.StatusTypes) 2;
esEmp.EnabledCaption = div_result(a, b).ToString("P2");
esEmp.Refresh();
MessageBox.Show("Showing 40");
} if (div_result(a, b) <= 79m) {
esEmp79.Status = (Ice.Lib.Framework.StatusTypes) 1;
esEmp79.EnabledCaption = div_result(a, b).ToString("P2");
esEmp79.Refresh();
MessageBox.Show ("Showing 79");
} if (div_result(a, b) >= 80m) {
esEmp80.Status = (Ice.Lib.Framework.StatusTypes) 0;
esEmp80.EnabledCaption = div_result(a, b).ToString("P2");
esEmp80.Refresh();
MessageBox.Show("Showing 80");
}
}
}
}
public decimal div_result(decimal a, decimal b) {
if (a > 0 && b > 0) {
return Math.Round(a / b, 2);
} else
return 0;
}
I would try something like this to see what those values are really doing. My syntax may be off a little, but this should get you close.
foreach(var row in grid.Rows) {
a += Convert.ToDecimal(row.Cells["Calculated_EstMins"].Value);
b += Convert.ToDecimal(row.Cells["Calculated_ActMins"].Value);
MessageBox.Show("a = " & a.ToString());
MessageBox.Show("b = " & b.ToString());
MessageBox.Show("div result = " & div_result(a, b).ToString());
} if (div_result(a, b) <= 40m) {
esEmp.Status = (Ice.Lib.Framework.StatusTypes) 2;
esEmp.EnabledCaption = div_result(a, b).ToString("P2");
esEmp.Refresh();
MessageBox.Show("(div_result(a, b) <= 40m) " & (div_result(a, b) <= 40m).ToString() );
} if (div_result(a, b) <= 79m) {
esEmp79.Status = (Ice.Lib.Framework.StatusTypes) 1;
esEmp79.EnabledCaption = div_result(a, b).ToString("P2");
esEmp79.Refresh();
MessageBox.Show ("(div_result(a, b) <= 79m) " & (div_result(a, b) <= 79m).ToString() );
} if (div_result(a, b) >= 80m) {
esEmp80.Status = (Ice.Lib.Framework.StatusTypes) 0;
esEmp80.EnabledCaption = div_result(a, b).ToString("P2");
esEmp80.Refresh();
MessageBox.Show("(div_result(a, b) >= 80m)" & (div_result(a, b) >= 80m).ToString());
}
}
I had to remove your code just after the foreach as it looped over 7 million times…
I still cannot get the colours to change based on a value.
private void edvV_TEAGLE_LabourDtlWthIndirect_1View_EpiViewNotification(EpiDataView view, EpiNotifyArgs args) {
// ** Argument Properties and Uses **
// view.dataView[args.Row]["FieldName"]
// args.Row, args.Column, args.Sender, args.NotifyType
// NotifyType.Initialize, NotifyType.AddRow, NotifyType.DeleteRow, NotifyType.InitLastView, NotifyType.InitAndResetTreeNodes
if ((args.NotifyType == EpiTransaction.NotifyType.Initialize)) {
esEmp.EnabledCaption = 0. ToString("P2");
if ((args.Row > -1)) {
EpiUltraGrid grid = (EpiUltraGrid) csm.GetNativeControlReference("6d1c93f1-f9e7-4671-b904-bad1d9934862");
double a = 0;
double b = 0;
foreach(var row in grid.Rows) {
a += Convert.ToDouble(row.Cells["Calculated_EstMins"].Value);
b += Convert.ToDouble(row.Cells["Calculated_ActMins"].Value);
// Debugging
} if (div_result(a, b) > 80 || div_result(a, b) < 100) {
esEmp.Status = StatusTypes.OK;
esEmp.EnabledCaption = div_result(a, b).ToString("P2");
esEmp.Refresh();
// Debugging
} else if (div_result(a, b) > 70 || div_result(a, b) > 69) {
esEmp.Status = StatusTypes.Warning;
esEmp.EnabledCaption = div_result(a, b).ToString("P2");
esEmp.Refresh();
} else if (div_result(a, b) > 40 || div_result(a, b) < 60) {
esEmp.Status = StatusTypes.Stop;
esEmp.EnabledCaption = div_result(a, b).ToString("P2");
}
}
}
}
public double div_result(double a, double b) {
if (a > 0 && b > 0) {
return Math.Round((a / b) * 1, 2);
}
else
return 0;
}
I changed it to double now as I thought the >
would be affecting or ignored due to being a decimal but this isn’t the case…
Anyone? Any ideas?
HELPPPPPP!!!
I messed around and got the epishape to change color with some simple code.
MessageBox.Show("Warning");
epiShapeC1.Status = StatusTypes.Warning;
MessageBox.Show("OK");
epiShapeC1.Status = StatusTypes.OK;
MessageBox.Show("Stop");
epiShapeC1.Status = StatusTypes.Stop;
This was just to prove that the shape can change color with the syntax you’re using. Perhaps you could assign your div result to a decimal (or double) variable before you do those if statements. That way the function only runs once. Then your if statements can compare to a variable, rather than to the result of a function. In reality they should be the same, but sometimes code is tricky like that. Something like:
double a = 0;
double b = 0;
double divresult = 0;
foreach(var row in grid.Rows) {
a += Convert.ToDouble(row.Cells["Calculated_EstMins"].Value);
b += Convert.ToDouble(row.Cells["Calculated_ActMins"].Value);
divresult = div_result(a, b);
// Debugging
} if (divresult > 80 || divresult < 100) {
esEmp.Status = StatusTypes.OK;
There are all sorts of calculations that could be performed and different companies measure their labor efficiency or Labor Effectivity or Labor Utilization depending on the type of product, scrap factors, quality factors, etc. My former employer measured both Efficiency and effectivity. I have seen some calculate utilization (based on available hours vs hours actually charged).
a nice article with multiple calculation methods is here: Overall labor effectiveness - Wikipedia
feel free to make your own BAQs, dashboards and reports based on your needs.
Hi Tim,
The calculation we are using is fine but the epiShapes dont change based on the percentage output. It’s displayed in the EnabledCaption perfectly but shows the wrong colour.
Loved reading that wiki page. I didnt realise you can calculate so many different types of efficiency and effectiveness.
Thanks for your help
Can this be shared?