Sorting tables on multiple columns in Confluence
Asked by Lis Riba:

Are there any plugins (or user macros) which can support sorting tables on **multiple** columns (with primary and secondary keys)?


Answers:
author: Andrey Khaneev _StiltSoft_
body: You can set [default sorting option](https://docs.stiltsoft.com/display/TableFilter/Managing+Look+of+the+Table+and+Filtration+Pane#ManagingLookoftheTableandFiltrationPane-Applyingthedefaultsortingordertocolumns) in [Table Filter](https://marketplace.atlassian.com/plugins/com.stiltsoft.confluence.plugin.tablefilter.tablefilter).


author: Laurent Corbi?re
body: Hi,

You can use the table-filter plugin. It's not sorting, but it's filtering:

<https://marketplace.atlassian.com/plugins/com.stiltsoft.confluence.plugin.tablefilter.tablefilter>

Using it with table-plus:

<https://marketplace.atlassian.com/plugins/org.swift.confluence.table>

I think that it will answer to your needs.

Have a nice day,

Laurent


author: Laith Abu Rakty
body: did u find a solution for this ?

comments: author: Katerina Kovriga {Stiltsoft}
body: Hi [@Laith Abu Rakty](/t5/user/viewprofilepage/user-id/754985) ,

You can try our app - [Table Filter and Charts for Confluence](https://marketplace.atlassian.com/apps/27447/table-filter-and-charts-for-confluence?hosting=cloud&tab=overview).

If you need to sort your table, you can use the [Table Filter](https://docs.stiltsoft.com/display/public/TFAC/Sorting%2C+freezing+and+other+table+viewing+options) macro to apply the default sorting to one or multiple table columns in the ascending or descending order.

![default sorting.png](https://docs.stiltsoft.com/download/attachments/42239875/default%20sorting.png?version=1&modificationDate=1551096495000&api=v2)

You'll be also able to apply different kinds of filters (dropdown, freetext, number range, date range, visual and global filters) to one or multiple table columns with the help of the same [Table Filter](https://docs.stiltsoft.com/display/public/TFAC/Table+filtration) macro. So you'll get the precise data based on several criteria.

![adding filters macro browser.png](https://docs.stiltsoft.com/download/attachments/42239755/adding%20filters%20macro%20browser.png?version=1&modificationDate=1550162238000&api=v2)

Besides our app will help you to create pivots, perform calculations in your tables, merge tables, etc.


author: Rodrigo Girardi Adami
body: Hi Lis,

I'm not sure if I understood your question correctly, but if you are looking to perform queries into Confluence database and show them in Confluence pages, I believe that you can use the SQL plugin for Confluence: <https://marketplace.atlassian.com/plugins/org.swift.confluence.sql>

Hope that helps! :)

Cheers,

Rodrigo Girardi Adami


author: Benjamin Feagin Jr
body: You can use the free [Table Enhancer](https://marketplace.atlassian.com/apps/1211609/table-enhancer-for-confluence?hosting=server&tab=overview) and nest multiple macros; the first layer is the primary, and each nested macro is the secondary, tertiary, etc. sorting column.


author: weweave UG
body: Although this post is quite old, we would like to let you know that we developed the app "DataTables for Confluence" (see <https://marketplace.atlassian.com/apps/1220302/datatables-for-confluence>) for Confluence Cloud which supports filtering tables by multiple columns (see <https://weweave.net/blog/datatables-for-confluence-supports-multi-column-table-sorting/>).


author: Stefan Eike
body: Hi Nicolas,

thank you for your reply. I wrote the developer an E-mail but now I see, that you're the developer. :)

Do you plan to release the source code of the plugin or to charge money someday for the plugin? Unfortunately a plugin which we use was free to use until last year and now we have to pay hundreds of euros every year for it. My boss was not very amused and because of that I need to make sure, that this does not happen again. Of course, you spend a lot of time developing it, but I want to avoid surprises like that again, therefore I'm cautious with installing free plugins.

Best regards

Stefan

comments: author: Adrien Ragot 2
body: Hi Stefan, I'm keen to answer, would you mind raising a separate question for this? Thanks!


author: Stefan Eike
body: No problem, [I did.](/questions/124546/will-the-playsql-plugin-stay-free-of-charge)


author: Adrien Ragot 2
body: Hi Lis, Hi Stefan,
> Is it possible without a commercial plugin as well?

[Play SQL](https://marketplace.atlassian.com/plugins/com.playsql.playsql-plugin?utm_source=AAC&utm_medium=forum&utm_campaign=playsql) is a free SQL plugin. In view mode, you can open the SQL panel and update the "ORDER BY" clause to sort by several columns. You can also use it to tune your filter.


author: Stefan Eike
body: Hi Laurent, OMG, that's pretty cool. I did not know the table-filter plugin. It helps me finishing another template, you saved my day. Thanks a lot!


author: Stefan Eike
body: Is it possible without a commercial plugin as well?


Tags: confluence-app

table