Table transformer SQL concat a date
Asked by Arica Chan:

Hi,

I am using table transformer to concat the content of a few columns into one before using it to put up on a gantt chart as a road map.

In the original table, I have the following columns:

* Feature
* Market
* Channel
* Phase
* Start date
* Target release Date (using date format d M yy)

In table transformer, I used the below SQL query:

SELECT \*, CONCAT(T1.'Feature', " \| ", T1.'Channel', " \| ", T1.'Phase', " \| ", T1.'Target release Date') as 'Combined' FROM T1

And the date format has been aligned through all the tables and charts.

Then I used the resulted table for Gantt chart (Chart from table), using Start date and Target release Date as values column, then Market and Combined (from table transformer) as labels column.

On the graph, the dates in the 'Combined' label is showing something like '1670169600000'.

Is there a way to show the dates in concat as some readable dates?

Thank you.


Answers:
author: Katerina Kovriga {Stiltsoft}
body: Hi [@Arica Chan](/t5/user/viewprofilepage/user-id/4952023) ,

Unfortunately I couldn't reproduce the issue. Here is how everything works for me:

![Mon 3-1.png](https://community.atlassian.com/t5/image/serverpage/image-id/200717i0218D368AD5C7614/image-size/large?v=v2&px=999 "Mon 3-1.png")SELECT T1.'Project', T1.'Phase', T1.'Start Date', T1.'End Date', T1.'Completion Ratio',  
CONCAT(T1.'Project' + " \| " + T1.'Start Date') as 'Project Combined'  
FROM T1

![Mon 3-2.png](https://community.atlassian.com/t5/image/serverpage/image-id/200718i1D178BDD408E4295/image-size/large?v=v2&px=999 "Mon 3-2.png")

![Mon 3-3.png](https://community.atlassian.com/t5/image/serverpage/image-id/200719i1BEE455FF9F24077/image-size/large?v=v2&px=999 "Mon 3-3.png")

Please check if your version of the [Table Filter and Charts for Confluence](https://marketplace.atlassian.com/apps/27447/table-filter-and-charts-for-confluence?tab=overview&hosting=server?utm_source=atl_community&utm_medium=answer&utm_campaign=table-filter-traffic-sources&utm_vendorID=1216111) app is up-to-date (the current one is 8.6.1).

If everything seems to be ok, please raise a [support request](https://jsd.stiltsoft.com/servicedesk/customer/portal/2) (attach the page storage format: upper right corner -\> menu ... -\> View Storage Format. If you don't see the option, ask your Confluence administrator to do it for you. Then we'll be able to recreate exactly your data and look into the issue).

comments: author: Arica Chan
body: Hi Katerina,

Thanks for your check.

Not sure if it relates to the date function that I used in the table? I used this format so to align everyone's input for the date in order for the gantt chart to work...

![Confluence table.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/200820i75BD12B927C1F5F2/image-size/large?v=v2&px=999 "Confluence table.PNG")

Then my gantt chart shows the date like '1670169600000' below.

![Confluence concat date.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/200821iC7A56DDE685B8289/image-size/large?v=v2&px=999 "Confluence concat date.PNG")


author: Katerina Kovriga {Stiltsoft}
body: Hi [@Arica Chan](/t5/user/viewprofilepage/user-id/4952023) ,

Still can't reproduce the issue: I've changed the dates for the Start Date column as you have on your screenshot (used a date picker).

![Tue 1-1.png](https://community.atlassian.com/t5/image/serverpage/image-id/200829iE103A2DE08DDC25C/image-size/large?v=v2&px=999 "Tue 1-1.png")

Check that you have a proper date format in the Table Transformer macro settings:

![Tue 1-2.png](https://community.atlassian.com/t5/image/serverpage/image-id/200830i5388DC2074EC9671/image-size/large?v=v2&px=999 "Tue 1-2.png")

The SQL query remains the same (see my previous reply). Check the last column - does your column look the same?

![Tue 1-3.png](https://community.atlassian.com/t5/image/serverpage/image-id/200831i7FC6B71CB24108AF/image-size/large?v=v2&px=999 "Tue 1-3.png")

And here is the result graph:

![Tue 1-4.png](https://community.atlassian.com/t5/image/serverpage/image-id/200832i6D49A6D0FB5A8623/image-size/large?v=v2&px=999 "Tue 1-4.png")

Do you have a proper output after the Table Transformer macro? The Chart from Table macro just uses your combined column as plain text so I suppose smth goes wrong after the concatenation. Again check the date format inside the Table Transformer macro.


author: Arica Chan
body: Hi [@Katerina Kovriga {Stiltsoft}](/t5/user/viewprofilepage/user-id/1464746) ,

I tried with a simple table on a new page, but the date is still not in correct format after concat. I checked the date format in table transformer. ![1.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/200835i39DF73C7066749DC/image-size/large?v=v2&px=999 "1.PNG")

SELECT \*, CONCAT(T1.'Feature' + " \| " + T1.'Channel' + " \| " + T1.'End date') as 'Combined' FROM T1

![date format.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/200837iF7BBD2A62613684F/image-size/large?v=v2&px=999 "date format.PNG")

But the date is still not showing in correct format.

![concat.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/200838i8B60975A7C724591/image-size/large?v=v2&px=999 "concat.PNG")

Any other idea on this?


author: Katerina Kovriga {Stiltsoft}
body: Please check the version of the app (update it if necessary, the current version is 8.6.1) and raise a support ticket with the page storage format attached - we'll try to look at the issue closely.


author: Katerina Kovriga {Stiltsoft}
body: You may also try to use the CONCAT_VIEW function instead of the CONCAT - maybe it will help you to preserve the initial formatting.


author: Arica Chan
body: Thank you. You have been helpful!


Tags: confluence-server

server