2 Replies Latest reply on Feb 24, 2017 4:58 AM by Edward Yeldham

    Year to date sales based on user selected date

    Edward Yeldham

      Hello,

       

      Our financial year (which I wish to report on) runs from 1st July to 20th June annually (ie a 6 month offset).

       

      I have sales reports with a parameter control in to allow the user to select a date.  The report should show the sales up to and including that date.  This allows them to look at reports retrospectively if they wish.

       

      I have a calculated field called YTD Sales This Year which is as below

       

      IF DATEDIFF('year',dateadd('month',6,[Transaction Date]),DATEADD('month',6, [Select Date])) = 0

       

      AND DATEPART('month',dateadd('month',6,[Transaction Date])) <= DATEPART('month',DATEADD('month',6,[Select Date]))

       

      THEN [Gbp Sales Value] ELSE 0 END

       

      The "transaction date" referred to is the date on my invoice data and the "select date" is the parameter control.  If i pick a date back a couple of weeks the calculation is not reflecting this and still showing me the full sales.

       

      I'm sure this used to work but am wondering if an upgrade has messed it up.

       

      Help please!

       

      Ed