3 Replies Latest reply: Sep 6, 2013 11:45 AM by Marcus Sommer RSS

    New instance of a well-known problem... LOOP running empty

    Friedrich Hofmann


      Hi,

       

      I once again face an issue concerning the failure of a LOAD statement that encounters no records.

      The challenge is this:

      - I am displaying data from a database that just started operating in August.

      => Thus, there is no data from Jan to July.

      - I would like to build my Dashboard parallel to one I already have, which displays the same kind of data, but from a database that
        has been operative for some years.

       

      - In the old Dashboard, I have a LOOP in the script:

           - It walks through the values 1 through 12 (for the months)

           - For every month, the LOAD statement sums up the amounts.

           => That enables me, on the GUI, to use a set_expression to define the month with the highest total within this year and display
                 that.

      - In the new Dashboard, I would like to do the same (getting Dashboards to look uniform is very important here)

      <=> The LOOP cannot be the same, at least not yet, for there is no data for the first 7 months -> that in itself would not be a problem,
              I would just load the month and a 0 in that case, I only want to make sure the LOOP continues.

       

      Now, in principle, I have done this in another scenario - finding out whether a LOAD was successful and, in case it wasn't, loading something constructed - but that was not in a LOOP.

      Can I create - and, more importantly, change - variables inside a LOOP?

      Otherwise, I would just have to create 12 variables in the script - for 12 months - and then query on of them in every iteration of the LOOP

       

      Can anybody help me in this?

      Thanks a lot!

      Best regards,

       

      DataNibbler