BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ankush23
Calcite | Level 5

I have the below sample datalike 

 

Product

Subsidiary

Stores

Sales

BootAddis Ababa12$29,761
Men's CasualAddis Ababa4$67,242
Men's DressAddis Ababa7$76,793
SandalAddis Ababa10$62,819
SlipperAddis Ababa14$68,641
Sport ShoeAddis Ababa4$1,690
Women's CasualAddis Ababa2$51,541
Women's DressAddis Ababa12$108,942
BootAlgiers21$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?

1 ACCEPTED SOLUTION

Accepted Solutions
5 REPLIES 5
Reeza
Super User
WHERE Stores > 10

 

This can be added to a SQL or PROC or Data step query. Which one are you intending to use?

ankush23
Calcite | Level 5

Hi,

 

I want to add this to the Proc SQL

ankush23
Calcite | Level 5
HI Reeza I want to add this inside the Proc Sql code
Reeza
Super User

Then add the line after your FROM statement.

ankush23
Calcite | Level 5

Thank you Reeza,

 

Its working, I got the mistake I was doing. Was adding where statement after Group By.

 

Thanks a lot

 

Regards

Ankush

sas-innovate-2024.png

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.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 1523 views
  • 1 like
  • 2 in conversation