15 Replies Latest reply: Sep 1, 2011 2:38 AM by Riko Mahr RSS

    Problem with Set Analysis with a period of time

      Hello together,

       

      following problem occured:

       

      I have a database with approx.15.000.000 rows in which a turnover is included.

       

      Now I try to compare two years.

      The database begins in 02.01.2009 and ends yesterday.

       

      To get the sum of the turnover (Umsatz) of the actual year (Jahr) is quite simple:

      Sum({$<Jahr={$(=Only(Jahr))}>}Umsatz)

       

      But to get the turnover of the last year in the same period of time drives me nuts ;-)

      I tried it with following function which is not working, because it pics only the actual month and is not starting at 01. January till yesterday one year ago.

       

      Sum({$<Jahr={$(=Only(Jahr)-1)},MONAT={$(=month(JARECDAT))}>}Umsatz))

       

      Does anyone has an idea how to do that?

       

      JARECDAT is always a day before the actual date (=yesterday)

      MONAT means month

       

      Thany you very much for your help.