I have a piece of code that does roughly the following:
- Target values per day, shift (there are 2) and dpt. are loaded from a file;
- Minute_intervals are created from 05:20 (beginning of a working day) till 22:30 (end of a working day)
- They are joined.
The important point for now is: The code now generates time_intervals which we move towards - so the intervals are always in the future, so to speak. It looks like this:
if(Interval_Min<730,'07:30', if(Interval_Min<1000,'10:00', if(Interval_Min<1200,'12:00', if(Interval_Min<1400,'14:00', if(Interval_Min<1600,'16:00', if(Interval_Min<1830,'18:30', if(Interval_Min<2030,'20:30', if(Interval_Min<2230,'22:30','22:30')))))))) as Interval_2H,
The field Interval_Min has every minute of the day between the start- and end-times. These are not real timestamps of course, by now I have those, but that is not the point - this kind of nested IF-constructs is not quite my idea of efficiency. So would there be any other, slimmer way of doing this?