I have to do a bar graph the depend on shift hours, for that I have to calculate a specific OEE value, in the formula I have to determine if current time is in 1st shift (06:00 - 15:00), 2nd shift (15:00-23:00) or 3rd shift (23:00-06:00) and calculate how many minutes are between current time and start of shift.
For example, if current time is 12:02, do 12:02 - 06:00 = 362 minutes, take this data and multiple with other fields.
I did :
round(sum((@Good_package_current - @Good_package_previous ) - (@Bad_package_current - @Good_package_previous )) / (8.5 * 60 * sum(date_trunc(@Start Time -‘06:00:00’)), 2)
But it’s not ok, got error on it, and it’s just a part of the expression (have to add the if …)
Please help me, how can I develop such expression ?