6 Replies Latest reply: Oct 9, 2015 3:01 AM by Bart Rottink RSS

    Current selection sales vs same period last year

      Hi, I'm trying to compare sales from current selection vs same period -12 months. So if for example my current selection period is Oct 1st 2014 to Mar 31st 2015 I want to compare with Oct 1st 2013 to Mar 31st 2014. I have found following statements:

      sum({$<[ProductType]={'Bananas'},CR.InvoiceDate={">=$(=yearstart(min(CR.InvoiceDate)))<=$(=max(CR.InvoiceDate))"}>}Ticket_Amt) for Current Period and

      sum({$<[ProductType]={'Bananas'},CR.InvoiceDate={">=$(=yearstart(min(addyears(CR.InvoiceDate,-1))))<=$(=max(addyears(CR.InvoiceDate,-1)))"}>}Ticket_Amt) for previous period. Current Period works fine, however previous period keeps on giving 0 (there is sales for that period). What am I doing wrong? Thanks in advance for your help.