BookmarkSubscribeRSS Feed
AndersBergquist
Quartz | Level 8
I am trying to build an infomap. I have two tables, one with monthly data and one calender with everyday and corresponding month, quarter, year and some other carasteristicts.

I join the months to be able to aggregate on quarters and years.

The problem is the join will be perform on each day, which make the total aggregation about 30 times highter on yearly basis.

My question, is there a way to make the calenderfile only input one month, like distinct rows in sql?
2 REPLIES 2
GertNissen
Barite | Level 11
Is your month a SAS date column or a value describing the month number ?

My guess is that you should join by a SAS date column containing i.e. the last day of the month. This way your data will not be 30 timer higher.

Make a new column containing the date of the last day in the month - instead of your currently column that contains the month number - you will get the month from your calender table.
AndersBergquist
Quartz | Level 8
Thats the way. It works perfekt.
Thank You.

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!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 984 views
  • 0 likes
  • 2 in conversation