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 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 703 views
  • 0 likes
  • 2 in conversation