Number formatting AlaSQL Table transformer

Matias G Labrana April 24, 2024

Hello community,

I would like to receive support to something that maybe is silly to ask but I cannot find clearly answers about this topic.
I have this initial table:
Captura de pantalla 2024-04-24 111846.png

And I would like through table transformer, convert the numeric values in a kind of currency values, like this:
Captura de pantalla 2024-04-24 111920.png
As you can see in Column A, the values are rounded but not in Column B, is just for see the differences.
In my initial table the values are not changing when I am manipulating the settings in table transformer regarding to "decimal" and "thousand" separators.
And also through AlaSQL i cannot find enough info that can provide me a solution in terms of format currencies or just let my numeric values looking as currencies. 
Do you know any solutions?
Thanks in advance for the help provided!  

1 answer

3 votes
Stiltsoft support
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.
April 24, 2024

Hi @Matias G Labrana ,

Let me suggest using the Table Spreadsheet macro for applying different currency formats and performing various calculations with them later as you do it in Excel. 

But if you just need to present your table in a more convenient way, here is the query for your Table Transformer macro:

Wed 14-1.png

SELECT *,
"$" + FORMATNUMBER('Money') AS 'Formatted Money from Macro Settings',
"$" + FORMATNUMBER('Money', ".", ",", 1) AS 'Formatted Money',
"$" + FORMATNUMBER('Money', ".", ",", 0) AS 'Formatted and Rounded Money'
FROM T*

Wed 14-2.png

The FORMATNUMBER function without any arguments takes the decimal_separator, thousands_separator, decimal_places from the macro settings. You've mentioned that you set everything but they weren't applied - it seems that you didn't use the FORMATNUMBER function.

And the 2nd an 3rd variants with arguments are just to show the whole syntax (the result views seem to be exactly what you have on the second screenshot).

Hope it helps your case.

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events