Dear experts,
I have data set (sheet input in the attachment) and on the base of two variables, seller id and revenues, I wouldlike to group the data showing:
- top 5 sellers;
- residual part;
- absolute and percentage values;
(sheet output in the attachment).
I just used the proc sql to sort and then I selected the top 5 using the outobs in the proc sql but to get the full picure I want is taking too many steps. Any elegant and wuick solution to propose?
Thanks in advance.
BRs,
SH
This link https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... has instructions on how to turn a SAS dataset into a datastep. Then you can post text of the actual data (or your example data at least) in form that we can use to test code.
Many users here don't want to download Excel files because of virus potential, others have such things blocked by security software. Also if you give us Excel we have to create a SAS data set and due to the non-existent constraints on Excel data cells the result we end up with may not have variables of the same type (numeric or character) and even values.
Thanks for you advises, I cheked the proc rank but in the end I got what I needed using the dear old proc sql and a proc tabulate to finalize it.
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.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.