8 Replies Latest reply: Sep 10, 2012 8:12 AM by Alan Hendrickx RSS

    Logic challenge

      Hi All,


      I require some help regarding a logic challenge please....


      Up to now I have used simple IF logic statements. I now need to add some (slightly) more detailed logic into my QV app which in simple terms will do the following:

      1. Check 'PercentComp' field to see if a value exists or is null
      2. If a value exists (i.e. we have a entry on the system), then sum the records that meet certain criteria e.g. sum(if(CategoryDescription='Financial' and Due_Date>today(2), 1-(PercentComp/100), NULL))
      3. If a value does not exist then count the records that meet certain criteria e.g. count(if(status='open' and Due_Date>today(2) and CategoryDescription='Financial'


      The above fields reside in two tables:

      Table 1 = PercentComp

      Table 2 = CategoryDescription, Due_Date,status


      I am looking for guidance as to the best way to do this. I would ideally like to handle most of the logic within the script as I am getting 'Out of Object Memory' quite a bit.


      Many thanks,