2 Replies Latest reply on Mar 25, 2015 2:38 AM by Jonathan Squires

    Multiple date ranges

    Jonathan Squires

      Hello

       

      I am trying to draw a line graph with three date ranges, all the same length but not all the same start date.

       

      I want to overlay the lines so it makes a good comparison, but have no idea  how to do this... Any thoughts.

       

      I want to show the totals for each day. In the date range

        • 1. Re: Multiple date ranges
          Bora Beran

          You can shift the dates to align them. Since there is no workbook I will make some guesses

           

          Assuming each line is a ProductCategory

           

          You can get the first data point in each ProductCategory by writing the following in 9.0 using a level of detail expression

           

          {fixed ProductCategory : MIN(Date)}

           

          You can get the overall minimum (for the entire table) by writing

           

          {MIN(Date)}

           

          Now. Each category has to be shifted based on how far they are from the overall minimum which is

           

          {MIN(Date)} - {fixed ProductCategory : MIN(Date)}


          So your overall calculation would need to look like


          DATEADD('day', Date, {MIN(Date)} - {fixed ProductCategory : MIN(Date)})


          which shifts each row as many days as needed to align the first date of each product category.

          • 2. Re: Multiple date ranges
            Jonathan Squires

            thanks for this answer, but unfortunately I am still using 8.2 and am unable to upgrade at the present moment.

             

            Also I have picked out three different time periods for the same field i.e sales at Easter to be compared over three years.

             

            I have currently identified the time periods by adding parameters for the start and end date of all three periods then having three calculated fields current periods, Compare period 1 and Compare period 2 (using if statements to date select. )

             

            hopefully this adds a bit more detail to my original question