1 Reply Latest reply: Jun 10, 2016 6:00 PM by Stefan Wühl RSS

    If then loop

    kartik somasundaram

      I have the following table:

         

      DateEntry typeItemQtyGRN no.Vendor
      1-Jan-16GRNRBC1230010GRN-101ABC
      3-Jan-16SaleRBC12300-20SRN-678DEF
      4-Jan-16GRNRBC1230030GRN-102CDE
      5-Jan-16OutputRBC1230025ORN-345RC!
      6-Jan-16GRNRBC1230015GRN-103ABC
      1-Feb-16GRNRAC5678910GRN-101ABC
      3-Feb-16SaleRAC56789-20SRN-678DEF
      4-Feb-16GRNRAC5678930GRN-102CDE
      5-Feb-16OutputRAC5678935ORN-345RC!
      6-Feb-16GRNRAC5678915GRN-103ABC

       

       

      Table 2:  

      Closing stock of RBC 1230060
      Closing stock of RBC 1230070

       

       

      i need the following output :

      The system should compare recent Receipts (GRN and Output)

      with the closing stock. to the extent Receipts matches with the closing stock, it should consider.  

      6-Jan-16GRNRBC12300GRN-10315
      5-Jan-16OutputRBC12300ORN-34525
      4-Jan-16GRNRBC12300GRN-10220
      6-Feb-16GRNRAC56789GRN-10315
      5-Feb-16OutputRAC56789ORN-34525
      4-Feb-16GRNRAC56789GRN-10230

       

      for eg. in the output for item RBC 12300, GRN Qty is 30, but only 20 is considered as the sum total is equal to 60.

       

      kindly provide code for this in qlikview/

        • Re: If then loop
          Stefan Wühl

          I don't really understand your requested output description:

           

          - Are you only considering records looking back to the last sale as 'recent'? Or why have you left out 1-Jan and 1-Feb receipts?

           

          -"for eg. in the output for item RBC 12300, GRN Qty is 30, but only 20 is considered as the sum total is equal to 60."

           

          I am totally lost, can't get how you calculate 30, then consider only 20????