You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "srijani-smsrc (via GitHub)" <gi...@apache.org> on 2026/04/13 05:54:31 UTC

[D] FILTER SORT ORDER [superset]

GitHub user srijani-smsrc created a discussion: FILTER SORT ORDER

FILTER SORT ORDER — Quarters appearing alphabetically 
This is a known Superset issue but has workarounds. Create a calculated sort column in the underlying dataset (e.g., a numeric quarter_order field) and use the Sort Metric configuration in the filter to sort by that column while displaying the quarter label. This is a data modelling fix, not a platform limitation.


i need to sort the month not in alphabetical order but in chronologically order ... in superset 5.


@dosubot

GitHub link: https://github.com/apache/superset/discussions/39308

----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [D] FILTER SORT ORDER [superset]

Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
GitHub user dosubot[bot] added a comment to the discussion: FILTER SORT ORDER

<!-- Answer -->
You're on the right track with the approach you described! Superset's native filters have a built-in **Sort Metric** feature that handles exactly this. Here's how to get months sorted chronologically:

1. **Add a numeric sort column to your dataset** — Create a calculated column (e.g., `month_order`) that maps each month to its numeric value (January → 1, February → 2, … December → 12). You can do this in your database view/query or as a calculated column in the Superset dataset. For example in SQL: `EXTRACT(MONTH FROM your_date_column) AS month_order`.

2. **Configure the filter's sort settings** — In your dashboard's native filter configuration panel, expand the **"Sort filter values"** section [[1]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx#L1082). There you'll find:

   - **Sort type** — Set to ascending [[2]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx#L1107-L1111)
   - **Sort Metric** — Select your `month_order` column here [[3]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx#L1134)

This tells Superset to display the month name in the filter dropdown but sort the values using the numeric `month_order` column instead of alphabetically [[4]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/filters/components/Select/types.ts#L44).

The same approach works for quarters or any other values you need in a custom order. This works in Superset 5 — it's part of the native filter configuration UI, no code changes needed.


<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=brand-link).*

---
<sup>How did I do? [Good](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-great_response#message_id=de045022-c315-4469-8a06-f43b75fcea28&feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-irrelevant_answer#message_id=de045022-c315-4469-8a06-f43b75fcea28&feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-incorrect_sources#message_id=de045022-c315-4469-8a06-f43b75fcea28&feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-too_verbose#message_id=de045022-c315-4469-8a06-f43b75fcea28&feedback_type=too_verbose) | [Hallucination](https://app
 .dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-hallucination#message_id=de045022-c315-4469-8a06-f43b75fcea28&feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-bug_report#message_id=de045022-c315-4469-8a06-f43b75fcea28&feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-other#message_id=de045022-c315-4469-8a06-f43b75fcea28&feedback_type=other)</sup>
[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=chat-badge)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=You%27re%20on%20the%20right%20track%20with%20the%20approach%20you%20described%21%20Superset%27s%20native%20filters%20have%20a%20built-in%20%2A%2ASort%20Metric%2A%2A%20feature%20that%20handles%20exactly%20this.%20Here%27s%20how%20to%20get%20months%20sorted%20chronologically%3A%0A%0A1.%20%2A%2AAdd%20a%20numeric%20sort%20column%20to%20your%20dataset%2A%2A%20%E2%80%94%20Create%20a%20calculated%20column%20%28e.g.%2C%20%60month_order%60%29%20that%20maps%20each%20month%20to%20its%20numeric%20value%20%28January%20%E2%86%92%201%2C%20February%20%E2%86%92%202%2C%20%E2%80%A6%20December%20%E2%86%92%2012%29.%20You%20can%20do%20this%20in%20your%20database%20view/query%20or%20as%20a%20calcula
 ted%20column%20in%20the%20Superset%20dataset.%20For%20example%20in%20SQL%3A%20%60EXTRACT%28MONTH%20FROM%20your_date_column%29%20AS%20month_order%60.%0A%0A2.%20%2A%2AConfigure%20the%20filter%27s%20sort%20settings%2A%2A%20%E2%80%94%20In%20your%20dashboard%27s%20native%20filter%20configuration%20panel%2C%20expand%20the%20%2A%2A%22Sort%20filter%20values%22%2A%2A%20section%20%5B%5B1%5D%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx%23L1082%29.%20There%20you%27ll%20find%3A%0A%0A%20%20%20-%20%2A%2ASort%20type%2A%2A%20%E2%80%94%20Set%20to%20ascending%20%5B%5B2%5D%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx%23L1107-L1111%29%0A%20%20%20-%20%2A%2ASort%20Metric%2A%2A%20%E2%80%94%20Se
 lect%20your%20%60month_order%60%20column%20here%20%5B%5B3%5D%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx%23L1134%29%0A%0AThis%20tells%20Superset%20to%20display%20the%20month%20name%20in%20the%20filter%20dropdown%20but%20sort%20the%20values%20using%20the%20numeric%20%60month_order%60%20column%20instead%20of%20alphabetically%20%5B%5B4%5D%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/filters/components/Select/types.ts%23L44%29.%0A%0AThe%20same%20approach%20works%20for%20quarters%20or%20any%20other%20values%20you%20need%20in%20a%20custom%20order.%20This%20works%20in%20Superset%205%20%E2%80%94%20it%27s%20part%20of%20the%20native%20filter%20configuration%20UI%2C%20no%20code%20changes%20needed.)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord
 &logoColor=white&label=)](https://go.dosu.dev/discord-bot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=join-discord)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/discussions/39308)

GitHub link: https://github.com/apache/superset/discussions/39308#discussioncomment-16539760

----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [D] FILTER SORT ORDER [superset]

Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
GitHub user dosubot[bot] added a comment to the discussion: FILTER SORT ORDER

<!-- Answer -->
Here's how to set it up directly in the dashboard filter UI:

**Step 1 — Add a calculated column to your dataset**

1. Go to **Datasets**, find your dataset, and click **Edit**.

2. Go to the **Calculated Columns** tab [[1]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/components/Datasource/DatasourceEditor.jsx#L1742-L1780).

3. Click **"+ Add item"** and create a column called `month_order` with a SQL expression like:

   ```sql
   EXTRACT(MONTH FROM your_date_column)
   ```

   Or if your months are text labels:

   ```sql
   CASE 
     WHEN month_name = 'January' THEN 1
     WHEN month_name = 'February' THEN 2
     WHEN month_name = 'March' THEN 3
     WHEN month_name = 'April' THEN 4
     WHEN month_name = 'May' THEN 5
     WHEN month_name = 'June' THEN 6
     WHEN month_name = 'July' THEN 7
     WHEN month_name = 'August' THEN 8
     WHEN month_name = 'September' THEN 9
     WHEN month_name = 'October' THEN 10
     WHEN month_name = 'November' THEN 11
     WHEN month_name = 'December' THEN 12
   END
   ```

4. Save the dataset. Then create a **metric** on this column (e.g., `MIN(month_order)`) in the **Metrics** tab — this is needed because the Sort Metric dropdown works with metrics, not raw columns [[2]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx#L1120-L1174).

**Step 2 — Configure the dashboard filter**

1. Open your dashboard in **edit mode**.
2. Click the **gear icon** on the filter bar and select **"Add or edit filters"** [[3]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterBarSettings/index.tsx#L165-L176).
3. Select your month filter (or create a new one).
4. Scroll down to the **"Sort filter values"** section and expand it [[4]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx#L1080-L1082).
5. Set **Sort type** to "Sort ascending" [[5]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx#L1088-L1119).
6. In the **Sort Metric** dropdown, select the metric you created (e.g., `MIN(month_order)`) [[6]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx#L1137-L1142).
7. Save the filter configuration.

Your month filter should now display months in chronological order (January → December) instead of alphabetical.

Let me know what database you're using if you need help with the exact SQL syntax for the calculated column!


<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=brand-link).*

---
<sup>How did I do? [Good](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-great_response#message_id=a6139cc3-1ae6-4363-a2c3-62ecffcffcf5&feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-irrelevant_answer#message_id=a6139cc3-1ae6-4363-a2c3-62ecffcffcf5&feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-incorrect_sources#message_id=a6139cc3-1ae6-4363-a2c3-62ecffcffcf5&feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-too_verbose#message_id=a6139cc3-1ae6-4363-a2c3-62ecffcffcf5&feedback_type=too_verbose) | [Hallucination](https://app
 .dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-hallucination#message_id=a6139cc3-1ae6-4363-a2c3-62ecffcffcf5&feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-bug_report#message_id=a6139cc3-1ae6-4363-a2c3-62ecffcffcf5&feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-other#message_id=a6139cc3-1ae6-4363-a2c3-62ecffcffcf5&feedback_type=other)</sup>
[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=chat-badge)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=Here%27s%20how%20to%20set%20it%20up%20directly%20in%20the%20dashboard%20filter%20UI%3A%0A%0A%2A%2AStep%201%20%E2%80%94%20Add%20a%20calculated%20column%20to%20your%20dataset%2A%2A%0A%0A1.%20Go%20to%20%2A%2ADatasets%2A%2A%2C%20find%20your%20dataset%2C%20and%20click%20%2A%2AEdit%2A%2A.%0A%0A2.%20Go%20to%20the%20%2A%2ACalculated%20Columns%2A%2A%20tab%20%5B%5B1%5D%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/components/Datasource/DatasourceEditor.jsx%23L1742-L1780%29.%0A%0A3.%20Click%20%2A%2A%22%2B%20Add%20item%22%2A%2A%20and%20create%20a%20column%20called%20%60month_order%60%20with%20a%20SQL%20expression%20like%3A%0A
 %0A%20%20%20%60%60%60sql%0A%20%20%20EXTRACT%28MONTH%20FROM%20your_date_column%29%0A%20%20%20%60%60%60%0A%0A%20%20%20Or%20if%20your%20months%20are%20text%20labels%3A%0A%0A%20%20%20%60%60%60sql%0A%20%20%20CASE%20%0A%20%20%20%20%20WHEN%20month_name%20%3D%20%27January%27%20THEN%201%0A%20%20%20%20%20WHEN%20month_name%20%3D%20%27February%27%20THEN%202%0A%20%20%20%20%20WHEN%20month_name%20%3D%20%27March%27%20THEN%203%0A%20%20%20%20%20WHEN%20month_name%20%3D%20%27April%27%20THEN%204%0A%20%20%20%20%20WHEN%20month_name%20%3D%20%27May%27%20THEN%205%0A%20%20%20%20%20WHEN%20month_name%20%3D%20%27June%27%20THEN%206%0A%20%20%20%20%20WHEN%20month_name%20%3D%20%27July%27%20THEN%207%0A%20%20%20%20%20WHEN%20month_name%20%3D%20%27August%27%20THEN%208%0A%20%20%20%20%20WHEN%20month_name%20%3D%20%27September%27%20THEN%209%0A%20%20%20%20%20WHEN%20month_name%20%3D%20%27October%27%20THEN%2010%0A%20%20%20%20%20WHEN%20month_name%20%3D%20%27November%27%20THEN%2011%0A%20%20%20%20%20WHEN%20month_name%20%3D%20%27D
 ecember%27%20THEN%2012%0A%20%20%20END%0A%20%20%20%60%60%60%0A%0A4.%20Save%20the%20dataset.%20Then%20create%20a%20%2A%2Ametric%2A%2A%20on%20this%20column%20%28e.g.%2C%20%60MIN%28month_order%29%60%29%20in%20the%20%2A%2AMetrics%2A%2A%20tab%20%E2%80%94%20this%20is%20needed%20because%20the%20Sort%20Metric%20dropdown%20works%20with%20metrics%2C%20not%20raw%20columns%20%5B%5B2%5D%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx%23L1120-L1174%29.%0A%0A%2A%2AStep%202%20%E2%80%94%20Configure%20the%20dashboard%20filter%2A%2A%0A%0A1.%20Open%20your%20dashboard%20in%20%2A%2Aedit%20mode%2A%2A.%0A2.%20Click%20the%20%2A%2Agear%20icon%2A%2A%20on%20the%20filter%20bar%20and%20select%20%2A%2A%22Add%20or%20edit%20filters%22%2A%2A%20%5B%5B3%5D%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/d
 ashboard/components/nativeFilters/FilterBar/FilterBarSettings/index.tsx%23L165-L176%29.%0A3.%20Select%20your%20month%20filter%20%28or%20create%20a%20new%20one%29.%0A4.%20Scroll%20down%20to%20the%20%2A%2A%22Sort%20filter%20values%22%2A%2A%20section%20and%20expand%20it%20%5B%5B4%5D%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx%23L1080-L1082%29.%0A5.%20Set%20%2A%2ASort%20type%2A%2A%20to%20%22Sort%20ascending%22%20%5B%5B5%5D%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx%23L1088-L1119%29.%0A6.%20In%20the%20%2A%2ASort%20Metric%2A%2A%20dropdown%2C%20select%20the%20metric%20you%20created%20%28e.g.%2C%20%60MIN%28month_order%29%60%29%20%5B%5B6%5D%5D%28https%3A//github.com/apache/sup
 erset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx%23L1137-L1142%29.%0A7.%20Save%20the%20filter%20configuration.%0A%0AYour%20month%20filter%20should%20now%20display%20months%20in%20chronological%20order%20%28January%20%E2%86%92%20December%29%20instead%20of%20alphabetical.%0A%0ALet%20me%20know%20what%20database%20you%27re%20using%20if%20you%20need%20help%20with%20the%20exact%20SQL%20syntax%20for%20the%20calculated%20column%21)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=join-discord)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/discussions/39308)

GitHub link: https://github.com/apache/superset/discussions/39308#discussioncomment-16539879

----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [D] FILTER SORT ORDER [superset]

Posted by "srijani-smsrc (via GitHub)" <gi...@apache.org>.
GitHub user srijani-smsrc added a comment to the discussion: FILTER SORT ORDER

@dosu

how to do this in dashboard filters.


GitHub link: https://github.com/apache/superset/discussions/39308#discussioncomment-16539782

----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [D] FILTER SORT ORDER [superset]

Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
GitHub user dosubot[bot] edited a comment on the discussion: FILTER SORT ORDER

<!-- Answer -->
Here's how to set it up directly in the dashboard filter UI:

**Step 1 — Add a calculated column to your dataset**

1. Go to **Datasets**, find your dataset, and click **Edit**.

2. Go to the **Calculated Columns** tab [[1]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/components/Datasource/DatasourceEditor.jsx#L1742-L1780).

3. Click **"+ Add item"** and create a column called `month_order` with a SQL expression like:

   ```sql
   EXTRACT(MONTH FROM your_date_column)
   ```

   Or if your months are text labels:

   ```sql
   CASE 
     WHEN month_name = 'January' THEN 1
     WHEN month_name = 'February' THEN 2
     WHEN month_name = 'March' THEN 3
     WHEN month_name = 'April' THEN 4
     WHEN month_name = 'May' THEN 5
     WHEN month_name = 'June' THEN 6
     WHEN month_name = 'July' THEN 7
     WHEN month_name = 'August' THEN 8
     WHEN month_name = 'September' THEN 9
     WHEN month_name = 'October' THEN 10
     WHEN month_name = 'November' THEN 11
     WHEN month_name = 'December' THEN 12
   END
   ```

4. Save the dataset. Then create a **metric** on this column (e.g., `MIN(month_order)`) in the **Metrics** tab — this is needed because the Sort Metric dropdown works with metrics, not raw columns [[2]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx#L1120-L1174).

**Step 2 — Configure the dashboard filter**

1. Open your dashboard in **edit mode**.
2. Click the **gear icon** on the filter bar and select **"Add or edit filters"** [[3]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterBarSettings/index.tsx#L165-L176).
3. Select your month filter (or create a new one).
4. Scroll down to the **"Sort filter values"** section and expand it [[4]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx#L1080-L1082).
5. Set **Sort type** to "Sort ascending" [[5]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx#L1088-L1119).
6. In the **Sort Metric** dropdown, select the metric you created (e.g., `MIN(month_order)`) [[6]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx#L1137-L1142).
7. Save the filter configuration.

Your month filter should now display months in chronological order (January → December) instead of alphabetical.

Let me know what database you're using if you need help with the exact SQL syntax for the calculated column!


<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fsuperset).*

---

Docs are dead. Just use [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-tagline&utm_term=apache%2Fsuperset).

[![Leave Feedback](https://img.shields.io/badge/Leave%20Feedback-555555?style=flat)](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-feedback&utm_term=apache%2Fsuperset&message_id=a6139cc3-1ae6-4363-a2c3-62ecffcffcf5) [![Ask Dosu about superset](https://img.shields.io/badge/Ask%20Dosu%20about%20superset-2f7b3f?style=flat&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB3aWR0aD0iODYiIGhlaWdodD0iODkiIHZpZXdCb3g9IjAgMCA4NiA4OSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNNS4yOTIzNiAxMi43OTI4TDE3Ljc1OTMgNi42ODE4OFY3Mi41NjY3TDUuMjkyMzYgODQuMDYxOFYxMi43OTI4WiIgZmlsbD0iI0I0QkI5MSIvPjxwYXRoIGQ9Ik0xOC4yNTc1IDczLjExOTZMNTkuMTMyOSA3Mi43NDhMNTEuNzAxMSA4Mi40MDk1TDI5LjAzMzggODYuMjkxTDYuMjM5NjIgODUuMTU1NEwxOC4yNTc1IDczLjExOTZaIiBmaWxsPSIjNzc4NTYxIi8%2BPHBhdGggZD0iTTE3LjQ5MTYgMy43MzYzM0wzLjU4NTU3IDEyLjcwOTlWODMuNTc5MkMzLjU4NTU3IDg0Ljc1NDIgNC45ODU2My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IGQ9Ik0wLjM0ODYzMyA4NS40OTQ2QzAuMzQ4NjMzIDg1LjQ5NDYgMjkuNDg1NiA4NS44MzA5IDM0LjgwOSA4NS42OThDNDQuODMzNyA4NS40NDc3IDUxLjI4NzIgODQuNDAyIDU3LjUyNjkgNzguOTcyNEM2Mi44MTI5IDc0LjM3MjcgNzUuMTM0MiA1OS42ODM2IDc1LjEzNDIgNTkuNjgzNiIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLXdpZHRoPSI2LjE2NDgyIi8%2BPC9zdmc%2B)](https://github.dosu.com/apache/superset?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-ask-repo&utm_term=apache%2Fsuperset) [![Share Dosu with your team](https://img.shields.io/badge/Share%20Dosu%20with%20your%20team-1f6feb?style=flat)](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-share-team&utm_term=apache%2Fsuperset)

GitHub link: https://github.com/apache/superset/discussions/39308#discussioncomment-16539879

----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [D] FILTER SORT ORDER [superset]

Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
GitHub user dosubot[bot] edited a comment on the discussion: FILTER SORT ORDER

<!-- Answer -->
You're on the right track with the approach you described! Superset's native filters have a built-in **Sort Metric** feature that handles exactly this. Here's how to get months sorted chronologically:

1. **Add a numeric sort column to your dataset** — Create a calculated column (e.g., `month_order`) that maps each month to its numeric value (January → 1, February → 2, … December → 12). You can do this in your database view/query or as a calculated column in the Superset dataset. For example in SQL: `EXTRACT(MONTH FROM your_date_column) AS month_order`.

2. **Configure the filter's sort settings** — In your dashboard's native filter configuration panel, expand the **"Sort filter values"** section [[1]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx#L1082). There you'll find:

   - **Sort type** — Set to ascending [[2]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx#L1107-L1111)
   - **Sort Metric** — Select your `month_order` column here [[3]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx#L1134)

This tells Superset to display the month name in the filter dropdown but sort the values using the numeric `month_order` column instead of alphabetically [[4]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/filters/components/Select/types.ts#L44).

The same approach works for quarters or any other values you need in a custom order. This works in Superset 5 — it's part of the native filter configuration UI, no code changes needed.


<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fsuperset).*

---

Share context across your team and agents. Try [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-tagline&utm_term=apache%2Fsuperset).

[![Leave Feedback](https://img.shields.io/badge/Leave%20Feedback-555555?style=flat)](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-feedback&utm_term=apache%2Fsuperset&message_id=de045022-c315-4469-8a06-f43b75fcea28) [![Learn about superset with Dosu](https://img.shields.io/badge/Learn%20about%20superset%20with%20Dosu-2f7b3f?style=flat&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB3aWR0aD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gLTYuNTc5MTlWNy42MTUzMlpNNDIuNTgwNSA3LjYxNTMySDQ3LjgwMTNWLTYuNTc5MTlINDIuNTgwNVY3LjYxNTMyWk00MC43MDQgNy42MTUzMkg0Mi41ODA1Vi02LjU3OTE5SDQwLjcwNFY3LjYxNTMyWiIgZmlsbD0iYmxhY2siIG1hc2s9InVybCgjZG9zdS1kLWN1dG91dCkiLz48cGF0aCBkPSJNNjguOTIxNSAzNi4wMTM1QzY4LjkyMTUgMzYuMDEzNSA2NS43MzY5IDQ5LjQ3MzggNTEuNDIzMSA0OS40NzM4QzM3LjEwOTMgNDkuNDczOCAzMi41Nzg3IDM3LjM1OTYgMzIuNTc4NyAzNi4wMTM1IiBzdHJva2U9ImJsYWNrIiB
 zdHJva2Utd2lkdGg9IjcuNjkxNjEiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjxwYXRoIGQ9Ik0wLjM0ODYzMyA4NS40OTQ2QzAuMzQ4NjMzIDg1LjQ5NDYgMjkuNDg1NiA4NS44MzA5IDM0LjgwOSA4NS42OThDNDQuODMzNyA4NS40NDc3IDUxLjI4NzIgODQuNDAyIDU3LjUyNjkgNzguOTcyNEM2Mi44MTI5IDc0LjM3MjcgNzUuMTM0MiA1OS42ODM2IDc1LjEzNDIgNTkuNjgzNiIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLXdpZHRoPSI2LjE2NDgyIi8%2BPC9zdmc%2B)](https://github.dosu.com/apache/superset?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-learn-repo&utm_term=apache%2Fsuperset) [![Add Dosu to your team](https://img.shields.io/badge/Add%20Dosu%20to%20your%20team-1f6feb?style=flat)](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-add-team&utm_term=apache%2Fsuperset)

GitHub link: https://github.com/apache/superset/discussions/39308#discussioncomment-16539760

----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org