Is it currently possible to replace the sort functionality of a column? I am aware I can use off-field visuals but that only allows for a single column to be defined.
My use case is as follows, as Quicksight does not currently supporting conditionally hiding columns I have had to do a workaround where I have a custom column that changes the data displayed based on the field selected.
Where I am running into issues is due to the fact that the custom fields do not always display data of the same data type. I have thus converted the fields to a string column. See example below
Name |
custom_field1 |
custom_field_2 |
Bob |
1/1/2025 |
1/1/2025 |
Phil |
1/1/2025 |
1/1/2025 |
Tim |
1/1/2025 |
1/1/2025 |
Name |
custom_field1 |
custom_field_2 |
Bob |
10 days |
1/1/2025 |
Phil |
10 days |
1/1/2025 |
Tim |
10 days |
1/1/2025 |
The issue I then run into is the date’s obviously don’t sort properly and I would like to ensure that users are able to sort the date columns correctly when they are displayed and sort text columns correctly when displayed.
Not sure if this is possible or if I will need to rethink the design.
Hi @firzen23
Currently, QuickSight can’t do dynamic type sorting on a single column. If your column sometimes shows dates and sometimes text, you’ll need one of the work-arounds below. Most teams pick the twin-visual + conditional rule pattern because it preserves normal click-to-sort for viewers without any code.
Work arounds:
- Duplicate the table, one version shows the date field, the other shows the text field. Stack them in the same spot and add a conditional rule tied to your parameter so only the relevant visual is visible.
- Keep your display column as string, but add a hidden numeric field such as (date or a zero-padded text key). Apply an off-visual sort on that key.
Table visual supports only one off-visual (hidden) sort key, and viewers can’t toggle it.
QuickSight can hide or show whole visuals with conditional rules, but it can’t hide individual columns or change a field’s data type at runtime.
Please refer to the below documentations this might be helpful for you.
Hi Xclipse,
Thank you for your response seems what I am trying to do is not possible currently.
I previously had the duplicate table solution and stacking them but I found it incredibly frustrating to work on as a developer so I don’t want to head down that route again.
As I want them to be able to change the sort column I have decided to not mix data types and grouped all dates together and strings in a separate columns to ensure sorting works correctly. Show’s abit of redundant information but I think its cleaner for me to work and and for users to navigate