Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
ioannagr
Creator III
Creator III

line for last year comparison in line chart

Hello everybody,

In my line chart  x axis is date and on y axis measure is count(distinct ID).

I tried for comparison for each date last year to do another line with measure count(<date={'$(=Date(max(AddYears(date), -1),'DD/MM/YYYY')))' } , yet it doesn't work while I though i was spot on.

 

Could really use your help!

1 Reply
Nicole-Smith

You need to:

  1. Create a new field in your load script that contains Month and Day (without Year)
  2. Create a new field in your load script that is just Year
  3. Make the Month/Day field your first dimension on your chart
  4. Make the Year field the second dimension on your chart
  5. Your expression would simply be count(Field) 
    1. If you need to filter to only show 2 years, then add set analysis to the expression to filter to those because it will show a separate line for all years in your data