Dynamically sort table based on parameter

I have 3 parameters that dynamically change what columns are shown in a table. Is there a way to sort the columns based on which parameter is selected?

Hi @mroo11,
Currently, there is not an out of the box option to pre-sort based on various parameter options.
One work around that could be explored for this scenario, would be to use free-form layout, then setup a separate visual for each parameter option (with the correct sorting on each). Then set a rule for each visual that shows the visual based on the parameter selection (choose to hide all visuals by default). That way, when you change your parameter, you’ll only see the matching visual and it will already be sorted.

Let me know if you have any additional questions or if this works for your case.

Hi @mroo11 -

Sometimes you can get away with assuming that things will still work even if you can’t see them. See the example below, you can make a sort field and sort your table based on it, then hide the field, and disable sorting when you publish the dashboard.

Hope this helps

2025-02-04_08-41-35 (1)

https://community.amazonquicksight.com/c/gallery/44

Hi @robdhondt I am still facing errors when trying to sort based on different fields, getting a syntax error when trying to create the sort calculated field. Can this be done on calculated fields rather than fields coming directly from data source or is it an issue that the sort values are not available in the group visual section?

Hi @mroo11 -

Shouldn’t be an issue to use a calculated field. If you can share your calculated fields here and any error messages.

Some gotchas I would look for in your cfs is that you can’t use visual aggregations such as count() unless you are using a LAC-A or LAC-W. You also want to make sure you aren’t mixing strings with numeric types in your conditional function etc.