5 Replies Latest reply: Jan 6, 2010 2:26 AM by Oleg Troyansky RSS

    Dynamic set analysis

      Hi,

      I'm currently building a QV application, where each line in a straight table must use different bookmarks for the set analysis.

      In my small sample I use the following expression - which works perfectly:


      if (Line=1, sum({BM1} Amount),
      if (Line=2, sum({BM2} Amount),
      if (Line=3, sum({BM3} Amount),
      -1)))

      However, this expression is not very scalable, and I do not know the number of lines in advance.

      I have tried re-writing this to something like this:

      sum({$(=concat('BM0' & Line))} Amount)

      But it doesn't seem to work. Any ideas?

      Best regards

      Steen

        • Dynamic set analysis

          Hi Steen,

          I've tried upload a file but there is an error in the server, so, I write the solution:

          Create a variable: v_field = 'BM' & Max(Linea)

          The expression: =Sum({$(#v_field)} Amount )

          I hope this help you.

          Best regards.

          • Dynamic set analysis
            Oleg Troyansky

            Steen,

            the specific problem that you presented might not have the solution that you are looking for - mainly because Set Analysis expressions, naturally, are evaluated over the full data set, and they can't be calculated based on the line numbers.

            I'm questioning your initial statement that locked you into a problem with no solution:

             


            SteenOlesen wrote:I'm currently building a QV application, where each line in a straight table must use different bookmarks for the set analysis.


            Perhaps you could come up with a different technique that solves your business problem, except for using Bookmarks?