Hello gyys,
I want to create two variables Start_Period and End_Period like shown in below
Start_Period= End_Period (prev value for respective project)
End_Period = Start_Period + New_Cust - Cust_Left
What I have is Month Project New_Cust Cust_Left
what I need to do is Start_Period and End_Period
Month | Project | Start_Period | New_Cust | Cust_Left | End_Period | periodCalc |
11-Apr | a | 0 | 131 | 22 | 109 | 0.201835 |
11-May | a | 109 | 70 | 85 | 94 | 0.904255 |
11-Jun | b | 94 | 55 | 70 | 79 | 0.886076 |
11-Jul | a | 79 | 79 | 63 | 95 | 0.663158 |
11-Aug | a | 95 | 154 | 96 | 153 | 0.627451 |
11-Sep | b | 153 | 185 | 90 | 248 | 0.362903 |
11-Oct | aa | 248 | 181 | 103 | 326 | 0.315951 |
11-Nov | a | 326 | 161 | 114 | 373 | 0.30563 |
11-Dec | s | 373 | 231 | 97 | 507 | 0.191321 |
12-Jan | a | 507 | 183 | 86 | 604 | 0.142384 |
Any help would be highly appriciated.
Thanks in advance.
Mac
It seems you want to solve your assignment posting multiple questions.
Whats the problem are you facing to solve it. It's very straight forward calculation.
As a hint for start date.. read about retain or lag function.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.
Find more tutorials on the SAS Users YouTube channel.