BookmarkSubscribeRSS Feed
Filipvdr
Pyrite | Level 9

Hello all,

My customer wants to compare day by day how much profit they made. As their sales are dependable of holidays like Easter, Christmass, Valentine, ... or even if it's a saturday or a friday.

They have created a calendar to map these special dates.I take the example of Easter. For example: in 2013 it was 15/04, in 2014 it was 4/4 and in 2015 it was 10/4 (as an example). The dataset contains one line for each day in 2015.

DateCurrentYearDatePreviousYear
01/01/201502/01/2014
02/01/201503/01/2014
10/04/201504/04/2014
10/05/201509/05/2014

My dataset looks like this. I got all data from 1/1/2014 to today. The saledateLY is only filled in if the saledate is from this year.

SaleDateSaleDateLYProfit
01/01/2014100
01/01/2014120
04/04/2014100
10/04/201504/04/2014156
10/05/201509/05/2014

Can I use the parallel period, or the relative period to calculate the differences between the profits made between days, weeks, months and use the special calendar?

Thanks

Filip

3 REPLIES 3
Sam_SAS
SAS Employee


Hi Filip,

Unfortunately, the ParallelPeriod and RelativePeriod operators return a missing value when the smaller interval is by day.

There might be some workaround in how you build your dataset that would get the result you want, however.

Thanks,

Sam

Filipvdr
Pyrite | Level 9

Thanks for the answer.

I'm trying to create the dataset upfront. Thanks for the answer.

Pamela_JSRCC
Quartz | Level 8

I have to do something similar at work to report enrollment comparisons for the current term compared to the previous year's term.  Given a list of associated dates for the current year with the previous year,  I create a table that translates the current date to the "comparative" one for the previous year.  The "hard" dates are typically holidays like Labor Day.  Otherwise I try to match the same weekday so that weekends match up.  Once the table is created, it is easy to compare the appropriate dates.

 

Hope this helps.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

Tips for filtering data sources in SAS Visual Analytics

See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 2144 views
  • 0 likes
  • 3 in conversation