Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Table Transformer: Year gets thousands separator, 2,020.00 instead of just 2020

Torkil Sinkaberg Johnsen May 11, 2020

In the table transformer macro, I have an SQL that looks something like this:

SELECT
YEAR(CAST(Month AS date)) AS 'Year'
, OtherNumber
(...)

I want "OtherNumber" to have thousands separator and two decimals, but I want year to just look like "2020" instead of "2,020.00", without decimals or thousands separator.

I have tried casting to string:

CAST(YEAR(CAST(Month AS date)) AS string) AS 'Year'

But that just gave me "NaN" as values.

I have also tried to set date format to "yy" in the table transformer macro, but that does nothing either.

Any tips?

1 answer

1 accepted

0 votes
Answer accepted
Andrey Khaneev _StiltSoft_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 11, 2020

Hi @Torkil Sinkaberg Johnsen,

I tried and this query works for me

CAST(YEAR(CAST(Month AS date)) AS string) AS 'Year'

You can try this:

YEAR(CAST(Month AS date))::string AS 'Year'

 or

YEAR(CAST(Month AS date)) + " " AS 'Year'
Torkil Sinkaberg Johnsen May 11, 2020

No go with any of these. Even tried 

YEAR(CAST(Month AS date)) + "a" AS 'Year'

Ends up with saying "NaNa" ...

Must be an old version I am running. Very frustrating. 

Thanks for your help!

Andrey Khaneev _StiltSoft_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 11, 2020

Try to update the Table Filter and Charts app then. If this doesn't help, please open a support ticket.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events