5 Replies Latest reply: May 24, 2013 8:44 AM by Thomas Jensen RSS

    How to show the Sales for alternate six month in setanalysis

      Hi,

       

        I want to show the sales of alternate 6 months from backward of maximum orderdate in the databese.i use the following expression it works correctly. Can any one help  how to generalize this function as a single line expression

       

       

      =SUM({<[Order Date]={">=$(=MonthStart(($(#vMaxOrderDate))))<=$(=MonthEnd(($(#vMaxOrderDate))))"},Year=,Month=,Quarter=>

      +

      <[Order Date]={">=$(=MonthStart(($(#vMaxOrderDate)),-1))<=$(=MonthEnd(($(#vMaxOrderDate)),-1))"},Year=,Month=,Quarter=>

      +

      <[Order Date]={">=$(=MonthStart(($(#vMaxOrderDate)),-3))<=$(=MonthEnd(($(#vMaxOrderDate)),-3))"},Year=,Month=,Quarter=>

      +

      <[Order Date]={">=$(=MonthStart(($(#vMaxOrderDate)),-5))<=$(=MonthEnd(($(#vMaxOrderDate)),-5))"},Year=,Month=,Quarter=>

      +

      <[Order Date]={">=$(=MonthStart(($(#vMaxOrderDate)),-7))<=$(=MonthEnd(($(#vMaxOrderDate)),-7))"},Year=,Month=,Quarter=>

      +

      <[Order Date]={">=$(=MonthStart(($(#vMaxOrderDate)),-9))<=$(=MonthEnd(($(#vMaxOrderDate)),-9))"},Year=,Month=,Quarter=>

      }NetPrice)

       

       

       

       

      vMaxOrderDate contains Maximum orderdate of my databese.

      NetPrice is the one where unitprice*quantity-discount