BookmarkSubscribeRSS Feed
jtpalpillai
Calcite | Level 5

Hi,

I wanted to calculate the growth rate between two quarters and then pull out rows which have a growth rate less than the given threshold ( say, 70%), into a new dataset.

 

The data is like this:

Name   Desig.    Level    Area           Country   Q1   Q2   Q3   Q4   Q5

ABU    Manager  Level3   Global         UAE        100  109  111  106  121

SAU    Chief        Level4   Regional     Brazil       98    106  119  145  191

 

Whichever quarter and line item that violates the threshold must be pulled out and saved in another dataset, like:

Name   Desig.    Level    Area           Country    Q3   Q4  

SAU    Chief        Level4   Regional     Brazil       119  145 

2 REPLIES 2
mkeintz
PROC Star

I think you need to put more thought into the design of your output data set.  Every row (observation) in the data set will have the same variables.  But not every observation will have the same quarters pass your filtering criterion. While Q3 and Q4 for SAU-Chief-Level4-Regional-Brazil qualify, it may be Q2 and Q5 for another observation, and Q4 only for another.

 

So what do you really want the data set to look like?

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------
jtpalpillai
Calcite | Level 5

Thanks a lot for your time!

 

Sorry if I wasn't clearer earlier; I am new to this whole field of coding.

 

So basically I want to find the line items ( eg.SAU-Chief-Level4-Regional-Brazil ) which has atleast one instance where there is a growth rate of more than 70% between two quarters. So ideally, if there is a >70% growth btwn Q3 and Q4 of SAU-Chief-Level4-Regional-Brazil , then the output must be something like:

                                                              Q3   Q4

SAU-Chief-Level4-Regional-Brazil    119  145  

 

and such line items must be exported (proc export) as an excel output, where any line item with atleast one instance of >70% grwth must be filtered and exported.

 

 

sas-innovate-2024.png

📢

ANNOUNCEMENT

The early bird rate has been extended! Register by March 18 for just $695 - $100 off the standard rate.

 

Check out the agenda and get ready for a jam-packed event featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events. 

 

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
  • 2 replies
  • 458 views
  • 0 likes
  • 2 in conversation