Jun 28 2023 05:29 AM
I have a table (fed from SQL). where the table filters are used to select data by date range.
My issue is that using the UNIQUE function on the table data does not appear to take account the table filter(s) and always returns results for the entire unfiltered table. How do I get the UNIQUE function to work only on the filtered table data? @HansVogelaar kindly helped me last week with the attached file.
The object was to report on items purchased predominantly by a single customer.
Thanks for any help
Willy
Jun 28 2023 05:44 AM - edited Jun 28 2023 05:44 AM
@WillSmyth You could add a column to the blue table called "filtered" with the following formula:
=AGGREGATE(2,3,[@[TX_DATE]])
That will put a 1 on all rows shown by the filter and 0 on all rows that are not visible.
Then the formula in L2 could be:
=SORT(UNIQUE(FILTER(Table_ExternalData_1[ITEM],Table_ExternalData_1[filtered]=1)))
Jun 28 2023 06:18 AM
Jun 28 2023 06:31 AM
Solution@WillSmyth See attached. If that's not what you want, I don't know. Note that I filtered the table to show only items from 2023.
By the way, better to place the SORT(UNIQUE(FILTER(....))) formula in another sheet to avoid it from being hidden in case the filter hides the top rows of the sheet.
Jun 28 2023 06:34 AM
Jun 28 2023 07:01 AM
@WillSmyth But the formula in L2 seems to work for me.
Jun 28 2023 06:31 AM
Solution@WillSmyth See attached. If that's not what you want, I don't know. Note that I filtered the table to show only items from 2023.
By the way, better to place the SORT(UNIQUE(FILTER(....))) formula in another sheet to avoid it from being hidden in case the filter hides the top rows of the sheet.