Sorting Chart By Different Field Than The One Displayed
- 06-20-2024
Hi ewoytowitz
I noticed your question was about sorting in Compose SDK, so offering an alternative solution.
It should be possible by first running the query, then after results are returned, choosing which columns in the result to map to the chart (e.g. not all of them).
There's an example of useExecuteQuery with sorting here https://www.sisense.com/platform/compose-sdk/playground/?example=queries%2Fuse-execute-query-sorting
It's sorted by Year, then by revenue.You could imagine your eventCode as the year column in the example, with the sorting applied, and you only use the other columns in the chart mapping.
Example of mapping query results to a chart (instead of a table) here https://www.sisense.com/platform/compose-sdk/playground/?example=queries%2Fuse-execute-query
We will try to produce a more targeted example for this use case in future, thanks for the inspiration!
Steve