2 Replies Latest reply: Apr 23, 2013 1:16 AM by Thomas Jensen RSS

    dollor sign expression set analysis

      Hello

       

      Im confusing myself, so i need some one to explain me some difference

       

      when you eg. have expressions like this

       

      sum({$<Year={$(vPreviousYear)}, Product=>} amount)

       

      or

       

      sum({<Year={$(vPreviousYear)}, Product=>} amount)

       

      or

       

      sum({$<Year={(vPreviousYear)}, Product=>} amount)

       

      or

       

      sum({1<Year={$(vPreviousYear)}, Product=>} amount)

       

      or

      sum({1<Year={1(vPreviousYear)}, Product=>} amount)

       

      Can somebody tell me the difference between each or what each expression do?

       

      what if i have this expression

       

      sum({$<Year={$(vPreviousYear)}, Product=>} amount) - Can i then also have $ before Product? or how would you express that? or would you say Product=$something ??

        • Re: dollor sign expression set analysis
          Gysbert Wassenaar

          sum({$<Year={$(vPreviousYear)}, Product=>} amount)

          sum({<Year={$(vPreviousYear)}, Product=>} amount)

           

          These two are almost always equivalent. Only when you're using alternate states that may not be true. It sums amount using the default selections, but overriding selections in Year with whatever is stored in the variable vPreviousYear and disregarding any selections in Product.

           

          sum({$<Year={(vPreviousYear)}, Product=>} amount)

          This one doesn't dollar-expand the variable, so I don't think it will work correctly

           

          sum({1<Year={$(vPreviousYear)}, Product=>} amount)

          The 1 ignores all selections, so Product= is redundant. And Year is set to the value stored in the variable vPreviousYear.

           

          sum({1<Year={1(vPreviousYear)}, Product=>} amount)

          The second 1 is incorrect and the variable isn't dollar-expanded so this expression won't work correctly.