9 Replies Latest reply: Apr 25, 2017 6:37 PM by Jeff Clevenger RSS

    stumped and need help with calculation

    Jeff Clevenger

      I need to determine the best number of each record (of a range) by using a calculation to measure against a qty. Each record could contain a different range. My table data looks like this:

       

       

      LOAD * INLINE [
      Product, Qty, Min, Max
      a, 140, 25, 30
      b, 130, 20, 25
      c, 150, 30, 40
      ]
      ;

       

      So for product 'a', my result needs to be 28 (largest calculated value) based on the calculation below:

         

      QtyNumCalculated result = num*floor(Qty/Num)
      14025125
      14026130
      14027135
      14028140
      14029116
      14030120

       

       

         

      Hopefully, I am overthinking it.  Any advice you could provide would be greatly appreciated, thank you.