Forums

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

How to use Table Transformer to calculate "Static value" - "Jira macro count"

huangbin chen
Contributor
February 16, 2023

Hi Experts,

I would like to calculate the difference between a "static value" and "Jira Macro count" as below process, but seems my script cannot achieve this.

(Note - or even "Jira Macro count" - "Jira Macro count")

20230216-calculation-jira-macro.png

May I know how to achieve this?

Expected result:

20230216-calculation-jira-macro2.png

Thanks

1 answer

1 accepted

2 votes
Answer accepted
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.
February 16, 2023

Hi @huangbin chen,

The issue is not in the dynamic or static values, it's in the "issues" ending: you are trying to calculate the difference between strings (common sentences, for example, "10 issues") and numbers (for example, just "20").

So, to implement the case, you need to get rid of the "issues" endings and work only with numbers (not with strings).

Fri 9-1.png

SELECT *,
'B' - 'A' AS 'C'
FROM
(SELECT T1.'A' -> split(" ") -> 0 as 'A',
T1.'B' -> split(" ") -> 0 as 'B'
FROM T1)

Fri 9-2.png

Here we split our strings by spaces and leave only the first part (numbers) in the internal SELECT and then count the difference in the external SELECT.

huangbin chen
Contributor
February 19, 2023

Thanks a lot, this script works well !!

Like # people like this

Suggest an answer

Log in or Sign up to answer