BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ertweety
Obsidian | Level 7

I need some help on exporting a data set to excel.

 

My data looks like this;

 

date                colour       total   

02/01/2016     blue             2

02/01/2016     yellow          5

 

In my excel workbook, my report will be using vlookups to determine the number of blue vs. yellow on Feb.1st.  Therefore, I will be making a concatenated field of the date & colour.  I would like to make this concatenated field the first column (column A) in my data sheet and don't want to have to create the column daily.  How do I export the above 3 columns by skipping column A on my data sheet?  I would like to replace everything in the data sheet daily with the exception of column A.

 

1 ACCEPTED SOLUTION

Accepted Solutions
ertweety
Obsidian | Level 7

I have figured it out.  I concatenated the 2 fields.  Prior to concatenating I added 21916 to the date field.  Excel could then read the date.

View solution in original post

5 REPLIES 5
SASKiwi
PROC Star

A couple of thoughts:

 

  • You could easily do the analysis you describe in SAS without exporting to Excel.
  • If you still wish to use Excel you could concatenate your two columns in SAS, then export also column A. 
ertweety
Obsidian | Level 7

 

 

I tried to concatenate the 2 fields in sas but it concatenates differently than in excel because of the date.

SASKiwi
PROC Star

Please post what you want as your concatenated column and also what you have tried in SAS.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

As @SASKiwi mentioned, why do it in Excel at all, SAS is designed to do statistics?  If you have to use Excel, why use SAS?  You seem to be using things just because they are there.  

As for this concatenating columns, that doesn't sound like a good idea to me.  If you do it in SAS you can use group by <var1>,<var2>, or by group processing.  If using Excel then there are other functions available, countif() is one that jumps to mind.  Check what you need to do, and why, then decide what software is better suited to the purpose.

ertweety
Obsidian | Level 7

I have figured it out.  I concatenated the 2 fields.  Prior to concatenating I added 21916 to the date field.  Excel could then read the date.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 1299 views
  • 0 likes
  • 3 in conversation