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: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 1000 views
  • 0 likes
  • 2 in conversation