DATA Step, Macro, Functions and more

Vertical Summation. Any help appreciated!

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 7
Accepted Solution

Vertical Summation. Any help appreciated!

Hi all!

I'm currently stuck with a SAS issue regarding Vertical Summation which I hope someone might be able to solve for me Smiley Happy

I have a lot of information regarding different products which I have tried to illustrate beneth.

OrdernumberColorCustomer nameXXX
212913BlueJones3
212913RedJones3

212913

BlueJones3
212888GreenCarina2
212888YellowCarina2

What I am seeking is to create a new variable with the information on the size of the order the product was sold in.

Basicly I'm looking for is a function to summarize the amount of times ordernumber appears and then create a new variable telling me the size of the order the product was sold in (Illustrated by the name XXX, this could have been replaced with Ordersize).

Any help is much appreciated.

Thanks


Accepted Solutions
Solution
‎11-29-2014 02:53 PM
Super User
Posts: 17,840

Re: Vertical Summation. Any help appreciated!

proc sql;

create table want as

select *, count(*) as OrderSize

from have

group by OrderNumber;

quit;

View solution in original post


All Replies
Solution
‎11-29-2014 02:53 PM
Super User
Posts: 17,840

Re: Vertical Summation. Any help appreciated!

proc sql;

create table want as

select *, count(*) as OrderSize

from have

group by OrderNumber;

quit;

Occasional Contributor
Posts: 7

Re: Vertical Summation. Any help appreciated!

Works like a charm! Thanks

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 299 views
  • 1 like
  • 2 in conversation