2 Replies Latest reply: Apr 24, 2017 9:48 AM by beck bakytbek RSS

    Alternative in Script

    beck bakytbek

      Hi Folks,

       

      i got a sitaution:

      i use this expression to calculate an average of last 12 Month:

       

      sum(aggr(rangesum(above(sum({$<Period,Year,DateType={'Personal'}>}Amount),0,12))Link,Period))/12

       

      it does work, but it takes a bit a time,

       

      How can i implement such expression in script to make speed on the surface (UI) a bit faster.

       

      Thank a lot for any help

       

      Beck

        • Re: Alternative in Script
          Muñoz Héctor

          Hi Beck,

          What you could do is creating a new field with the following formula:

          If(DateType = 'Personal', Amount / 12, 0)     AS Amount2

           

          , with this new field you could change your current expression to:

          sum(aggr(rangesum(above(sum({$<Period,Year>} Amount2),0,12))Link,Period))

           

          Is not a bit change but, considering user selection implications, I donot think you can improve it more... unless you can group it by Link and Period in another table.

           

          Regards,

          H