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-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!

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