2 Replies Latest reply: May 17, 2012 6:40 PM by Aaron Couron RSS



      Hi All,


      Can anyone tell me how to calculate privious 12 months sales in script.

        • Scripting
          Oscar Ortiz

          You're going to have to be a bit more specific if you want any help with this...

          • Scripting
            Aaron Couron



            When creating my calendar table in my script, I usually have a line like this that creates a flag.

            IF(TempDate >=ADDMONTHS(MonthStart($(varToday)),-11),1,0) AS Current12MonthFlag,

            Then you can use set analysis to only pull sales for that flag:


            Hope this helps!