Forum Discussion
Create list based on multiple customer IDs
I need to define within the dataset 2 groups of customers. The dataset is approx 50,000 customers. Group A will contain approx 500 customers, and group B approx 500 customers. I effectively want to filter just group A and B - the rest can be discarded. How can I do this without manually typing out each customer individually? Thanks
Please provide sanitized sample data that fully covers your issue.
Please show the expected outcome based on the sample data you provided.
- Anonymous3 years agoNot applicable
OK, let's try this! Here is the data (or at least how it would look in Excel. I know the customer ID's of all customers in Group A, and Group B. I need a way to filter just to show these two groups of customers. My data is being pulled from the cloud so I can't (or at least I don't think) I can create a column to calculate this.
Customer ID City Type Month Revenue 1234567 London Retail January £ 22,536 6549872 London Retail January £ 23,770 1232209 Leeds Leisure January £ 25,004 6547514 London Leisure January £ 26,238 1229851 New York Leisure January £ 27,472 6545156 London Retail January £ 28,706 1227493 Leeds Retail January £ 29,940 6542798 London Finance January £ 31,174 1225135 New York Retail January £ 32,408 6540440 Leeds Finance January £ 33,642 1222777 New York Finance January £ 34,876 6538082 New York Retail January £ 36,110 1220419 Leeds Retail January £ 37,344 6535724 New York Finance January £ 38,578 1218061 New York Finance January £ 39,812 6533366 London Finance January £ 41,046 1215703 London Retail January £ 42,280 6531008 Leeds Retail January £ 43,514 Simply put, I don't want any of the customers marked NA below to appear in my dataset.
Customer ID City Type Month Revenue 1234567 London Retail January £ 22,536 Group B 6549872 London Retail January £ 23,770 NA 1232209 Leeds Leisure January £ 25,004 NA 6547514 London Leisure January £ 26,238 NA 1229851 New York Leisure January £ 27,472 Group A 6545156 London Retail January £ 28,706 Group B 1227493 Leeds Retail January £ 29,940 NA 6542798 London Finance January £ 31,174 NA 1225135 New York Retail January £ 32,408 NA 6540440 Leeds Finance January £ 33,642 Group A 1222777 New York Finance January £ 34,876 Group A 6538082 New York Retail January £ 36,110 Group A 1220419 Leeds Retail January £ 37,344 NA 6535724 New York Finance January £ 38,578 NA 1218061 New York Finance January £ 39,812 NA 6533366 London Finance January £ 41,046 NA 1215703 London Retail January £ 42,280 NA 6531008 Leeds Retail January £ 43,514 Group B - lbendlin3 years agoSuper User
Here is an example. Feel free to modify/adjust. It will also work when the "NA" customers are missing from the dimension table. Understanding blank row and limited relationships - SQLBI