How do I calculate gross sales from Order Quantity and Unit Price in SAS 9.4?
| Order Quantity | Unit Price | Gross Sales |
| 20 | $37.72 | |
| 11 | $35.85 | |
| 1 | $37.72 | |
| 28 | $35.85 | |
| 8 | $37.33 | |
| 20 | $35.85 | |
| 15 | $37.72 | |
| 1 | $37.33 | |
| 16 | $12.10 | |
| 19 | $13.64 | |
| 30 | $35.85 | |
| 13 | $37.72 | |
| 5 | $12.10 | |
| 26 | $37.33 | |
| 9 | $12.10 | |
| 8 | $13.64 | |
| 23 | $35.85 | |
| 17 | $13.64 | |
| 11 | $37.72 | |
| 26 | $37.33 | |
| 3 | $37.33 | |
| 6 | $12.10 | |
| 7 | $37.72 | |
| 28 | $13.64 | |
| 19 | $35.85 | |
| 26 | $13.64 | |
| 11 | $37.33 | |
| 24 | $35.85 | |
| 27 | $37.72 | |
| 21 | $13.64 | |
| 16 | $35.85 | |
| 15 | $35.85 | |
| 4 | $12.10 | |
| 29 | $37.72 | |
| 3 | $13.64 | |
| 14 | $35.85 | |
| 12 | $37.72 | |
| 10 | $37.72 | |
| 6 | $35.85 | |
| 8 | $37.72 | |
| 20 | $37.33 | |
| 22 | $13.64 | |
| 25 | $37.33 | |
| 2 | $12.10 | |
| 26 | $35.85 | |
| 30 | $37.72 | |
| 20 | $37.72 | |
| 28 | $35.85 | |
| 25 | $12.10 | |
| 17 | $37.72 |
First figure out what is the name of the dataset. Let's say it is named HAVE.
Second figure out what are the names of the variables. Let's say they are named QUANTITY and PRICE.
Now you have the information you need to write some code.
data want;
set have;
gross = quantity*price;
run;
First figure out what is the name of the dataset. Let's say it is named HAVE.
Second figure out what are the names of the variables. Let's say they are named QUANTITY and PRICE.
Now you have the information you need to write some code.
data want;
set have;
gross = quantity*price;
run;
Thanks!
Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.
Explore Now →SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.