Forums

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

decimal points appear on simple integer addition on table transformer

emagnun
Contributor
December 2, 2021

I have a table to track jira task based on their status as below.Capture.JPG

The inner table-transformer is to get the numbers properly for each status column. I use split function to retrieve the numbers.  (eg: T1.'To Do'->split(" ")->0 AS 'To Do')

Capture1.JPG

The outer table transformer is to add a total column that sums up each status column. But the output adds decimal points to the total column, i dont know why.

Capture2.JPG

 

I tried to use ROUND(T1.'To Do' + T1.'In Progress' + T1.'Done' AS 'Total',0) as well, but decimal points still there.  Pls help.

 

 

2 answers

1 accepted

5 votes
Answer accepted
Katerina Kovriga _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.
December 2, 2021

Hi @emagnun ,

Check the settings of your Table Transformers -> Decimal places. You may have "2" there (if earlier you used macros with this precise settings, the current macro may catch it).

emagnun
Contributor
December 2, 2021

got it... my bad. it was the settings.

So ROUND() can not override if the settings has it 2?

Katerina Kovriga _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.
December 2, 2021

No, and it is always better to leave this field blank if you use ROUND() inside the SQL query.

Like # people like this
emagnun
Contributor
December 2, 2021

@Katerina Kovriga _Stiltsoft_ I tried to combine two table-transformers into 1 by the adding below yellow query, but it seems to be working as string concatination. How do I get this to work as integer addition?

Capture.JPG

Capture1.JPG

Katerina Kovriga _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.
December 2, 2021

Try this SQL:

SELECT T1.'Sprint',
T1.'To Do'->split(" ")->0 AS 'To Do',
T1.'In Progress'->split(" ")->0 AS 'In Progress',
CAST((T1.'To Do'->split(" ")->0) AS INT) + CAST((T1.'In Progress'->split(" ")->0) AS INT) AS 'Total'
FROM T*

Adjust it to the third "Done" status, I have the two statuses.

Like # people like this
emagnun
Contributor
December 2, 2021

Worked like a charm. Thanks

1 vote
Katerina Kovriga _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.
February 10, 2022

Hi there,

As this question mentions our Table Filter and Charts for Confluence app, we are happy to introduce its new macro – Table Spreadsheet.

The new macro allows you to work with fully functional Excel spreadsheets right in Confluence.

You’ll be able to use cells’ formulas, filters, conditional formatting, etc., create pivot tables and charts from the page view and edit mode.

The Table Spreadsheet macro is available for Cloud and Server/Data Center.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events