In an analytic app I am trying to make a dynamic drop-down box that feeds into a Filter tool be in descending order instead of the default ascending order. It looks like the cross tab tool is where the issue starts as I am sorting in descending order in the previous tool.
I have looked at numerous posts, searching for "Alteryx descending order within drop down list" and various forms of that. Post https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/How-to-customize-sort-order-us... seemed close but isn't what I need. Also, while post https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/How-to-customize-sort-order-us... initially looked promising the @order - value attribute shown in the action tool with a manually created list is not present when using a dynamic list.
I'm including a screenshot of a mockup flow with dummy data to show what I've created thus far. The drop down clearly works, I just need it to be in descending order so the most recent value is listed first. I'm thinking I would either have to re-order the columns after the cross tab tool or use another interface tool to add sort functionality to the Action tool but I just can't see the path for either.
Action tool config:
Current workflow drop-down box only displays in ascending order.
Solved! Go to Solution.
pre crosstab -> sort on your values column. use recordid. crosstab on recordid as name/value as value. use dynamic rename to take your column names -> feed into tool.
Have you tried to add Sort Tool just after the Cross Tab tool, just before you connecting to the Drop down tool?
@apathetichell
OH! That makes sense. I had tried using that record id tool but hadn't connected the dots to dynamically rename the columns using the first row of data. The row of data is technically lost but since it's feeding into the drop down tool that doesn't matter. Awesome solution thank you!
new configuration:
sort order working as desired:
@OTrieger
Unfortunately with only one field of data the cross tab tool puts everything on one row so there is no data to sort. Also it won't sort the column headers, which is what the drop down tool picks up for display.
@fmilliren- thanks! the recordid/rename way is also useful because of how crosstab handles special characters in column names (ie it regex replaces them with an underscore) - if your dates were labeled as say 2025-04-10 - you'd see it as 2025_04_10 if you used your original solution. the dynamic replace avoids this issue.