In a table visualization, I want to sort first by a date ("Last Listed’) and then by the number of sales cycles something was has been listed in (“Listed Cycles”). When I sort by these two fields in that order, the output is not as expected. The Listed Cycles should be ordered: 7, 5, 5, 5… but instead they start out 4, 1, 5… (assuming the values in the screenshot are the only values in the data set). When I switch the order of the two sort parameters, the sorting works as expected: descending by Listed Cycles and then Descending by Last Listed within groups that share the same number of Listed Cycles.
If I understand correctly, your “Last Listed” field is currently set to the DateTime type instead of Date type. You are using the Format option in the visualization to display it as a Date.
In this case, even though the values in the “Last Listed” column of your table appear identical, they are not truly the same underneath.
Let’s look at an example:
Suppose I have a table with “Order Created At” and “Discount” columns.
Although “Created At” now displays as “Aug 07 2021”, the underlying data still includes the exact timestamp.
As a result, the “Discount” column is not sorted correctly by the “Created At” values because the actual underlying values are still DateTime, not just Date.
The format only changes how the data is displayed, not the data itself
This is how the sorting looks beneath the formatted view:
To resolve this, I suggest reverting the format back to DateTime and changing the granularity of the original date field to Date instead. This ensures that the underlying data matches the displayed data.