9 Replies Latest reply: Feb 13, 2018 6:47 AM by kenny vroonen RSS

    Time in shifts

    kenny vroonen

      Hello,

       

      We work in shifts. Now I would like to measure the output per shift.
      Which formula can I use to divide the time field (bearbzeit) into shifts.

       

      eg.        from 06:00-14:00       shift vroege

       

                   from 14:00-22:00       shift late

       

                   from 22:00-06:00       shift nacht

       

                   from 06:00-15:00       shift ISO

       

       

       

      THX

       

       

        • Re: Time in shifts
          bruno bertels

          Hi

           

          May be somethink like this in your script

           

           

          if(bearbzeit<='22:00','shift late',

          if(bearbzeit<='15:00','shift ISO',

          if(bearbzeit<='14:00','shift vroege',

          if(bearbzeit<='06:00','shift nacht')))) as shifts,


          Bruno


          • Re: Time in shifts
            kenny vroonen

            This is the loadscript:

             

            LIB CONNECT TO ' ?????????';
            [Master]:
            LOAD
                firstvalue(time(sperrzeit)) as Tijdstip,
                firstvalue(date(zeit)) as Datum,
                etikettnr,
                firstvalue(esnr) as Machine_nr,
                firstvalue(auftnr) as /*Order_nr*/key1,
                firstvalue(pos) as /*pos*/key2,
                esname as Machine,
                firstvalue(bearbzeit) as bearbzeit,
               
                if(sperrzeit<'22:00','Late',
                if(sperrzeit<'14:00','Vroege',
                if(sperrzeit<'6:00','Nacht'))) as Shifts
               

            where auftnr<>0 and esnr>22 and esnr<=2930 and (esname='ISO-lijn 1 (Out)' or esname='ISO-lijn 2 (Out)' or esname='Gelaagd Lijn (Out)' or esname='Buigoven groot (uit)' or esname='Gelaagd Lijn (Out)'
            or esname='Busetti F12 (Out)' or esname='Zandstralen' or esname='Lisec ESL 60/30 RS' or esname='Bottero' or esname='Lisec VSL-45' or esname='Oven (uit)'
            or esname='Intermac (Out)' or esname='Waterjet (Out)' or esname='Vacuum Lagen (Out)' or esname='RBB (Out)') and len(etikettnr)=9

            group by etikettnr,esname;

            LET vRowCounter = NoOfRows('Master');
            TRACE $(vRowCounter) rows loaded in table "Master";

            SQL SELECT auftnr,

                pos,

                glasart,

                warengrp,

                produktgrp,

                breite,

                hoehe,

                flaeche,

                auftnr_pos

            FROM ???????;

              • Re: Time in shifts
                max payne

                where you are creating sperrzeit????


                I don't see it in your sql script.


                Regards,


                 

                  • Re: Time in shifts
                    kenny vroonen

                    sorry I copied the wrong script

                     

                    LIB CONNECT TO '............................';
                    [Master]:
                    LOAD
                        firstvalue(time(sperrzeit)) as Tijdstip,
                        firstvalue(date(zeit)) as Datum,
                        etikettnr,
                        firstvalue(esnr) as Machine_nr,
                        firstvalue(auftnr) as key1,
                        firstvalue(pos) as key2,
                        esname as Machine,
                        firstvalue(bearbzeit) as bearbzeit,
                       
                        if(sperrzeit<'22:00','Late',
                        if(sperrzeit<'14:00','Vroege',
                        if(sperrzeit<'6:00','Nacht'))) as Shifts
                       

                    where auftnr<>0 and esnr>22 and esnr<=2930 and (esname='ISO-lijn 1 (Out)' or esname='ISO-lijn 2 (Out)' or esname='Gelaagd Lijn (Out)' or esname='Buigoven groot (uit)' or esname='Gelaagd Lijn (Out)'
                    or esname='Busetti F12 (Out)' or esname='Zandstralen' or esname='Lisec ESL 60/30 RS' or esname='Bottero' or esname='Lisec VSL-45' or esname='Oven (uit)'
                    or esname='Intermac (Out)' or esname='Waterjet (Out)' or esname='Vacuum Lagen (Out)' or esname='RBB (Out)') and len(etikettnr)=9

                    group by etikettnr,esname;

                    LET vRowCounter = NoOfRows('Master');
                    TRACE $(vRowCounter) rows loaded in table "Master";

                    SQL SELECT

                        sperrzeit,
                        zeit,
                        etikettnr,
                        esnr,
                        auftnr,
                        pos,
                        esname,
                        bearbzeit
                    FROM ..................;