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 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 2450 views
  • 0 likes
  • 3 in conversation