1 Reply Latest reply on Apr 24, 2017 12:17 PM by Walt Reed

    Help with YoY bar chart file

    Alex Martino

      I'm looking at this file and need some help with the setup (attached):


      I'm trying to understand hwo everything fits together.


      There is a field called "Order Date Unified":

      DATE(DATEADD('year', YEAR([Today]) - YEAR([Order Date]), [Order Date]))

      Is this subtracting a year from the parameter "Today"? I'm not sure what the purpose of that is.


      That field is used in "YTD comparison":

      IF [Order Date Unified] <= [Today] AND

          YEAR([Order Date]) = YEAR([Today]) THEN "Sales YTD This Year"

      ELSEIF [Order Date Unified] <= [Today] THEN "Sales YTD Previous Year"

      ELSE "Sales after YTD"


      The first part is just saying that last year is less than today. Won't that always be the case since "today" is part of "order date unified" calc? I don't really understand this.



        • 1. Re: Help with YoY bar chart file
          Walt Reed

          Hi Alex,

          Can you explain whether you are trying to accomplish something in particular or just trying to reverse engineer the formula to understand what's going on?


          To answer your question, from what I can tell, Order Date Unified is basically taking the Year selected in the Today Parameter, and converting ALL dates to that year. For example, if Today Parameter = 1/31/13, then ALL order dates are converted to the same date, but the year would be 2013 (e.g., 1/31/10 now equals 1/31/13).


          YTD Comparison:

          Sales YTD This Year = all sales from this year (based on the year of Today Parameter)

          Sales YTD Previous Year = all sales from previous year (based on the year of Today Parameter)

          Sales after YTD = all sales from all other years (so if Today Parameter = 1/31/12, sales from 2010 and 2013 would be in this category).