3 Replies Latest reply: Nov 29, 2012 7:47 AM by Peter Cammaert RSS

    Recursive looping tables

      I have been trying to run this in SQL but it isn't playing ball, so am now attempting in QV script - I need to split a total amount by the number of months that have been run.
      Raw Data looks like this
      IDnumber of monthsTotal Value
      AAA113260
      AAA215275
      and I need to convert it to look like this for each ID
      IDNumber of monthsCurrent MonthTotal ValueCurrent Value
      AAA1131260Total Value/Number of Months
      AAA1132260Total Value/Number of Months
      AAA1133260Total Value/Number of Months
      AAA1134260Total Value/Number of Months
      AAA1135260Total Value/Number of Months
      AAA1136260Total Value/Number of Months
      AAA1137260Total Value/Number of Months
      AAA1138260Total Value/Number of Months
      AAA1139260Total Value/Number of Months
      AAA11310260Total Value/Number of Months
      AAA11311260Total Value/Number of Months
      AAA11312260Total Value/Number of Months
      AAA11313260Total Value/Number of Months
      The number of months range from 3 up to 300.
      Thanks in advance,
      CJ