How can I return unique values without using SQL?

Freitag

Board Regular
Joined
Jan 26, 2008
Messages
108
How can I return unique values from Table 1 where there are multiple associated records in Table 2? For example, table 1 is a quarterly report with thousands of records & has fields: division, store number,item#, percentage (12 items/measures per uniquedivision). Table 2 lists store# & state. To return the state associated with the division, I have to link the two tables. The problem is that there are multiple stores per division (it appears that all stores in a division are in the same state). How can I design my query grid to return only unique division numbers & their associated state w/o using SQL?

Please help!!
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Bob,

Yes, that is correct; ONLY using the QBE & NOT SQL - I don't know SQL yet.

Thanks!!
 
Upvote 0
Normally, writing SQL you would use a subquery to do this. But, in light of your requirements, you would write one query from ONLY table 1 and using the Group button, group on DIVISION and STORE #
Using this button:
sigma.png

And save that query. Then create a new query where you have that query and table two and link store #. Then you should be able to select DIVISION, STORE and STATE and have your output (if I read it correctly).
 
Upvote 0
Thanks, Bob! Will this also return each of the 12 measures by division (I do need this)?
 
Upvote 0
That will generate 12 records for each division/state. If you want this then I think you may want to use a report which can do grouping and stuff and not have duplicate values.
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,732
Members
448,987
Latest member
marion_davis

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top