I have the below sample datalike
Product | Subsidiary | Stores | Sales |
Boot | Addis Ababa | 12 | $29,761 |
Men's Casual | Addis Ababa | 4 | $67,242 |
Men's Dress | Addis Ababa | 7 | $76,793 |
Sandal | Addis Ababa | 10 | $62,819 |
Slipper | Addis Ababa | 14 | $68,641 |
Sport Shoe | Addis Ababa | 4 | $1,690 |
Women's Casual | Addis Ababa | 2 | $51,541 |
Women's Dress | Addis Ababa | 12 | $108,942 |
Boot | Algiers | 21 | $21,297 |
I want to Group by data basis the Product but only for Subsidiaries where count of stores is > 10. Then I want Group by of Product with count of such store and total sales from such Products (where store count is >10).
How to do this in SAS?
Then add the line after your FROM statement.
WHERE Stores > 10
This can be added to a SQL or PROC or Data step query. Which one are you intending to use?
Hi,
I want to add this to the Proc SQL
Then add the line after your FROM statement.
Thank you Reeza,
Its working, I got the mistake I was doing. Was adding where statement after Group By.
Thanks a lot
Regards
Ankush
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.