Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Sorry to trouble the community once more!
In load script I am calculating and creating a new field [Line hours] from a field of minutes (VGW02 or VGW03), a base quantity and a confirmed qty divided by 60 for hours.
((([VGW03]/[BMSCH]) * [GMNGA])/60) + ((([VGW02]/[BMSCH]) * [GMNGA])/60) as [Line Hours],
This is based on two calculations, the first half is machine hours ((([VGW03]/[BMSCH]) * [GMNGA])/60), the second part Labour hours ((([VGW02]/[BMSCH]) * [GMNGA])/60) .
The calculation works, but I have an issue with end values where VGW03 and VGW02 both have positive values (one or the other should normally be 0, but this is not always the case).
As such I only want it to add the second part + ((([VGW02]/[BMSCH]) * [GMNGA])/60) if the first half calculated as 0.
In theory:
((([VGW03]/[BMSCH]) * [GMNGA])/60) = line hours
if line hours = 0 then add this......
+ ((([VGW02]/[BMSCH]) * [GMNGA])/60)
= line hours
Hope that makes sense, I am probably over thinking it!
Regards Daryn
Try this
If (VGW03 = 0,((([VGW02]/[BMSCH]) * [GMNGA])/60),((([VGW03]/[BMSCH]) * [GMNGA])/60)) as [Line hours]
Try this
If (VGW03 = 0,((([VGW02]/[BMSCH]) * [GMNGA])/60),((([VGW03]/[BMSCH]) * [GMNGA])/60)) as [Line hours]
Hi and thank you for taking the time to read and reply.
This works perfectly!
Many thanks have a great Friday and weekend.
Regards, Daryn