The target date format is 11-Feb-2022.
But when I use this format, the date sorting is based on number and then alphabet (believing it is a string now) . Let me show you the picture.
I change the date format into d M yy in table edit page in setting and then it looks like the picture.
And one more thing : when the format is M - D -YYYY , there is 0 in front of some date cell, Please check the [Pre Date].
all data are from jira.
Here is the JQL
SELECT 'IMPORT',
FORMATWIKI(SUM('ITEM'+"\n")) AS 'Item',
FORMATWIKI(SUM( ’Date'+ "\n ")) as 'Date',
FORMATWIKI(sum('Pre Date'+"\n" )) as 'Pre Date',
FROM (
SELECT 'Import', 'Item' ,
FORMATDATE('Date') as 'Date',
FORMATDATE('Pre Date') as 'Pre Date'
FROM T* ORDER BY 'Item' , 'Date' ASC
) T1
GROUP BY 'Item'
Hi @CYH ,
You are right and the Date column is treated as a string data after the FORMATWIKI manipulations.
I'm not really sure what exactly you had into the original table coming from the Jira Issues macro, but I've created a regular Confluence table, copied your query with the ordering by 'Date' ASC and get the same result.
The simplest option is to use the second Table Transformer: leave all the data manipulations in the first one and use the second one only for sorting.
Now we see that the dates are sorted correctly.
And don't forget to choose the corresponding Date Format in the Table Transformer macro settings:
And as you use our Table Filter and Charts for Confluence app, note that recently we've released a new macro - Table Spreadsheet. Please check out new Excel functionality right in Confluence: the macro is available for Cloud and Server/DC.
Hi Katerina
your suggestion of " to format data, then sort the dates when they are still in separate cells and then group the already sorted fields by something " works so well !
I am stuck in group them first.
Thank you so much !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The Date format inside the first Table Transformer macro settings is the result format that comes from the FORMATDATE function that you use in the first query.
In the first question you said that the desired output is 11-Feb-2022, so use the dd-M-yyyy format twice.
The first variant uses two different formats: at first you change the date to the YYYY-MM-DD and then sort these dates as d M yy.
The second variant seems better and should be working fine.
I also paid attention that you try to sort several dates inside one cell - this may be the problem. The Table Transformer macro works with tables as with SQL databases, I mean with cells, not with aggregated pivot tables (in my example I used non-grouped table).
Try to format your data, then sort the dates when they are still in separate cells and then group the already sorted fields by something.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Katerina,
I try to use the second Table Transformer but it doesn't work.
Here is the inside (The first one) Table and the Date format in settings is 'YYYY-MM-DD':
Here is the outside table transformer:--the result of date format is the same
and the date format in setting is d M yy (1 Apr 2022)
Another Try:
Set first table date format as d M yy
result : disorder sorting of Due Date
Continue to set second table date format as d M yy
result : disorder sorting of Due Date
Could you check which part I did wrong?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.