3 Replies Latest reply: Jul 12, 2012 6:48 AM by Yme Joustra RSS

    Simple variable expressions work differently from direct expressions.

      Oke, it is possibly very simple or already answered, but I have no idea what is going wrong and I tried a lot of answers on this discussion forum.


      I have data like this:


      2010                    value

           1-1-2010           5

           1-2-2010           6

           1-3-2010           5




      This is the result when using for 'value': sum(value), which is good!


      But now I want this being saved in a variable. So I create a variable: 'total_value' with description: '=sum(value)' and then I refer the value expression to total_value so: 'value becomes' : = total_value.


      When I do this the result is:


      2010                    total_value

           1-1-2010           16

           1-2-2010           16

           1-3-2010           16




      Which is wrong! I still need the same results, 5 and 6. What am I doing wrong? To me it seems nothing really changed, only changed the location of calculating the values.


      I do this for simplifying a query. What am I doing wrong.


      Best regards.