I want to read in an Excel table like the following. The table extends to the right with more years and months under the year. The entire window is from August 2012 to September 2017.
Year | 2012 | ||||||||||||||
Month | 8 | 9 | 10 | 11 | 12 | ||||||||||
Product | Net Sales Units | Net Sales $ | Product Margin $ | Net Sales Units | Net Sales $ | Product Margin $ | Net Sales Units | Net Sales $ | Product Margin $ | Net Sales Units | Net Sales $ | Product Margin $ | Net Sales Units | Net Sales $ | Product Margin $ |
I would like to read it into SAS and transform the table into something like this:
Product Year_Month Net_Sales_Units Net_Sales$ Product_Margin$
This can be done by reading the table into SAS and performing manual manipulations. But is there a quicker way to achieve that? Thanks.
Sorry the table got screwed up a bit. It should be 3 columns (Net Sales Units, Net Sales$, Product Margin$) under each month (8,9..12).
I think you need to provide better sample data in this case.
I figured it out. Sorry for the the lack of clarity in my question. Mod please feel free to delete this post if that's consistent with forum rules. Thank you.
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.
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.