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
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.