Compare two different time series on the same graph?

Compare two different time series on the same graph

Compare two different time series on the same graph?

1.Create two parameters for starting Date and ending Date.

2.Now create start Date parameter as shown below.

two different time series on the same line graph

3.Then create end date parameter as shown below.

Compare two different time series on the same graph

4.create a calculation field for current period as shown below.

Compare two different time series on the same graph

5.now creat a parameter for reference period.

Compare two different time series on the same graph

6.now creat the calculation for reference period parameter,calculations look like below.

Compare two different time series on the same graph

IF([Reference Period]=”Directly preceding period”)

THEN

IF([Order Date]>=(DATEADD(‘day’,DATEDIFF(‘day’,[End Date],[Start Date])+1,[Start Date])) AND [Order Date]<[Start Date])

THEN

“Reference: “+STR(DATE(DATEADD(‘day’,DATEDIFF(‘day’,[End Date],[Start Date]),[Start Date])))+” – “+STR([Start Date]-1)

ELSE “Hide”

END

ELSEIF

([Order Date]>=(DATEADD(‘year’,-1,[Start Date])) AND ([Order Date]<=(DATEADD(‘year’,-1,[End Date]))))

THEN

“Reference: “+STR(DATE(DATEADD(‘year’,-1,[Start Date])))+” – “+STR(DATE(DATEADD(‘year’,-1,[End Date])))

ELSE “Hide”

END

END

  1. Now create the calculation for the Reference Period,

Compare two different time series on the same graph

8.Now creat a calculation for days since start of reporting period  as shown below.

Compare two different time series on the same graph

  1. Now drag Days since start of reporting period Into Columns. Right Click on that field and select Add Table Calculation. Now select Specific Dimension as Day of Order Date, as shown below.

Compare two different time series on the same graph

  1. Drag sales into Rows.
  2. Drag Reporting Period into filter and Exclude Null values then click on apply then click on Ok.
  3. And change the chart type as Line.
  4. Drag reporting period into color self at marcs card level.
  5. Drag Order Date into Detail at marks card level, and change the date part into Days.
  6. Now change the Dates at Start Date and End Dates.
  7. Now the visualization looks like below.

Compare two different time series on the same graph

 

Leave a Reply

Your email address will not be published. Required fields are marked *