Help using Base SAS procedures

preparing longditual data

Reply
Contributor
Posts: 65

preparing longditual data

Hİ i have a problem with the data i am dealing with

i have counts of active products for different stores which are identifiedwith storeID and unfortunately my database updates quarterly figures cross sectionally

Store IDDateACTIVE Products
45015822Q125
45015821Q126
32626111Q117
32626112Q102
21651562Q128

However i just need to report them as

Store ID2Q12_ACTIVE Products 1Q12_Active Products1Q11_Active Products 2Q10 Active Products
45015825
3262611 672
21651568

could please offer me a quick way to do it...

Super Contributor
Posts: 543

Re: preparing longditual data

Hi.

How about this?

data have;

input

  Store_ID Date $ ACTIVE_Products;

  cards;

4501582 2Q12 5

4501582 1Q12 6

3262611 1Q11 7

3262611 2Q10 2

2165156 2Q12 8

;

proc sort data = have;by store_id;

proc transpose data = have out = want(drop = _NAME_) suffix = Active_Products;

  id date;

  var active_products;

  by store_id;

run;

Good luck,

Anca.

Ask a Question
Discussion stats
  • 1 reply
  • 122 views
  • 0 likes
  • 2 in conversation