Reputation: 1
In the database I'm working with, there is a table with date ranges, which is separate from the main data I'm pulling, but I would like to use the table for filter options.
This is the main table with the data I need:
Data | MatchingID |
---|---|
A | 59 |
B | 59 |
C | 7 |
This is the table with the date ranges that I would like to have as filter options, it is inner joined with the table above but none of the data is needed except for filtering purposes:
Start Dt | End Dt | Type | MatchingID |
---|---|---|---|
2022-07-12 | 2023-07-03 | Year23 | 59 |
2023-07-04 | 2023-07-10 | Week2 | 59 |
2023-06-04 | 2023-06-10 | Week2 | 7 |
Is it possible to use this table to create a date filter that the user could select the Type they want and it show only data from Start date to End date?
I tried using a calculated field for this, but, perhaps due to my limited knowledge, it does not seem possible to do this.
Upvotes: 0
Views: 107
Reputation: 204
Since you are using an inner join for the two tables, the resulting data in your final table should simply look like this:
Data | MatchingID | Start Dt | End Dt | Type | MatchingID |
---|---|---|---|---|---|
A | 59 | 2022-07-12 | 2023-07-03 | Year23 | 59 |
A | 59 | 2023-07-04 | 2023-07-10 | Week2 | 59 |
B | 59 | 2022-07-12 | 2023-07-03 | Year23 | 59 |
B | 59 | 2023-07-04 | 2023-07-10 | Week2 | 59 |
C | 7 | 2023-06-04 | 2023-06-10 | Week2 | 7 |
Since you say you would like the user to be able to select the Type
, you can simply drag the Type
pill to the filters shelf, and then right-click it and select "Show Filter".
Upvotes: 1