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

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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