I've got an SSRS report with several different drop-down parameter menus, each of which depends on the selections in the menus before them. The report is taking similar data from several different tables, so there is some repeated data, and these values are showing up multiple times in the menus. For example, say I select sites A, B, and C; each of these sites may have warehouses called WH1 and WH3, so "WH1" and "WH3" each show up multiple times in the Warehouse drop-down menu.
I know that the reason it's doing this is because I have both Site name and Warehouse name in my SQL query, and, even though I have the queries for each table joined with a UNION, which should eliminate duplicates, I'm selecting both the Site and Warehouse columns from each table, so each combination of Site and Warehouse is considered a unique value. I can't take the Site column out of the query, because I need to filter the Warehouse menu by Site. Is there a way to get only the unique values of Warehouse for the menu?
Here's my SQL query for the dataset which feeds the Warehouse parameter. The dataset also has a simple filter based on the Site chosen in the first menu.
SELECT DISTINCT Site, Warehouse
FROM T1
UNION
SELECT DISTINCT Site, Warehouse
FROM T2
UNION
SELECT DISTINCT Site, Warehouse
FROM T3
ORDER BY T$CWAR