GitHub user gobeah added a comment to the discussion: ID / Name label option 
for Native Filters

The feature is not implemented yet, but you can use a hack.
You have 'channels' table:
| id | name |
|--------|--------|
| 1 | sports |
| 2 | cars |
| 3 | entertainment | 

And you have 'news' table:
| id | title | channel_id |
|--------|--------|--------|
| 1 | My first car | 2 |
| 2 | He scores! | 1 |
| 3 | World cup | 1 |
| 4 | Car sale | 2 |
| 5 | Championship 2025 | 1 |
| 6 | Pool party | 3 | 

### Solution
1. Go to SQL Lab and enter this query:
`SELECT`
`  id,`
`  title,`
`  ch.name AS channel_name`
`FROM news n`
`LEFT JOIN channels ch ON n.channel_id = ch.id`
2. Save query as new dataset 'news_extended'.
3. Create new chart (e.g. table) using 'news_extended' dataset.
4. Place chart on dashboard.
5. Add new native filter with settings:
- filter type: Value
- filter name: Channels
- dataset: news_extended
- column: channel_name
6. Save filter and enjoy.
![photo_2025-06-06 22 33 
17](https://github.com/user-attachments/assets/d98748c8-cd22-46d8-9ddd-c4be52be75d0)

p.s. it is important to use 'news_extended' dataset for all charts and filters 
to make it work.

The filter will be performed by the channel_id, since there is no channel_name 
field in the news table (dataset is virtual).


GitHub link: 
https://github.com/apache/superset/discussions/26084#discussioncomment-13393637

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: 
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to