5 Replies Latest reply: Jul 12, 2016 9:19 AM by Eric Hannert RSS

    simple if in data editor

    Eric Hannert

      hi com,

       

      i have this section in my editor:

      -------------------------------------------------------------------

      temp:

      NOCONCATENATE

      load articlenumber,amount,date as in_date

      Resident time_TAB

      where "in/out" ='in';

       

      left join

       

      load articlenumber,date as out_date

      Resident time_TAB

      where "in/out" ='out';

       

      time_in_company:

       

      Load articlenumber,in_date,out_date,

      out_date-in_date as diffdate resident temp;

      -------------------------------------------------------------------

      now i want the diffdate to be 0 when its drops below 0, cause a product cant be for -5 days in the company.

       

      i tried some if constelations but i didn't work!

      Help pls, thanks in advance!

      Eric

        • Re: simple if in data editor
          Sunny Talwar

          May be this:

           

          temp:

          NOCONCATENATE

          LOAD articlenumber,

                    amount,

                    date as in_date

          Resident time_TAB

          where "in/out" ='in';

           

          left join (temp)

          LOAD articlenumber,

                    date as out_date

          Resident time_TAB

          where "in/out" ='out';

           

          time_in_company:

          LOAD articlenumber,

                    in_date,

                    out_date,

                    out_date-in_date as diffdate

          Resident temp

          Where out_date-in_date >= 0;

            • Re: simple if in data editor
              Eric Hannert

              ok i changed some settings and everythings works fine.

              • Re: simple if in data editor
                Eric Hannert

                now i try to do the same with a counter for the amount of unit in and out so i have a more realistic number.

                So i count down the first date till every unit is out and then take the next in-date!

                Do u have some advice for me or tips?

                  • Re: simple if in data editor
                    Sunny Talwar

                    Not sure I understand what the issue now is? Can you elaborate?

                      • Re: simple if in data editor
                        Eric Hannert

                        so for example u have this story:

                         

                        article     amount       in/out        date

                        1              20               in          2/4/2016

                        1              2                 in          4/6/2016

                        1              5                 out        10/6

                        1              17               out        12/6

                         

                        so the first one would be 5 out from 2/4 - 10/6 in store

                        and the other one would be 17

                                                                15 from 2/4 to 12/6

                                                      and      2 drom 4/6 to 12/6

                         

                        so First in First out but with a count down of the amount so the numbers are korrekt!

                        Thx for ur help in advance!