BookmarkSubscribeRSS Feed
omerzeybek
Obsidian | Level 7

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

1 REPLY 1
AncaTilea
Pyrite | Level 9

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.

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 1 reply
  • 581 views
  • 0 likes
  • 2 in conversation