Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

I cannot get a simple substraction between Custom Fields value to work

Xavier Lecomte February 25, 2020

Hello 

I need a field to be populated with the number of month to go till the end of the year.

His number will be based on a custom Start Date. In a separate question Ludo has helps me parsing the Month number from a Custom Start Date Field. 

Now I have this "Month Number" parsed I want to do :  

"# Months to go" = "13" minus "Month Number"

I don't understand why the following syntax does not work : 

when custom field "Probable Start Date" is set to a date, set custom field "PROB MONTH" to "{{%Probable Start Date}~MM}", and set custom field "YTG Impact" to "{{%FY+1}} - {{%Prob Month})"

All custom fields below  are number (except date) 

"YTD +1" being set to "13"

"Probable Start date" being set to "April, 15, 2020" 

"Prob Month" is correctly evaluated as "4"

but "YTG Impact" is incorrectly set to "13" when I expect 13 - 4 = "9"

I have also tried : 

set custom field "YTG Impact" to "13 - {{%Prob Month})"

same result the set always consider only the first term of the operation 

  

2 answers

2 accepted

0 votes
Answer accepted
Iain Dooley
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 25, 2020

@Xavier Lecomte this works for me:

when custom field "Start Date" is set to a date, set custom field "Prob Month" to "{{%Start Date}~MM}", and set custom field "YTG Impact" to "{{%FY+1}} - {{%Prob Month}}"

I think your only problem is that you have included a close parenthesis instead of a closing curly brace, that is this:

when custom field "Probable Start Date" is set to a date, set custom field "PROB MONTH" to "{{%Probable Start Date}~MM}", and set custom field "YTG Impact" to "{{%FY+1}} - {{%Prob Month})" <---- note the parenthesis here

should be this:

when custom field "Probable Start Date" is set to a date, set custom field "PROB MONTH" to "{{%Probable Start Date}~MM}", and set custom field "YTG Impact" to "{{%FY+1}} - {{%Prob Month}}" <---- note the curly brace here rather than the close parenthesis

Xavier Lecomte February 27, 2020

Hey Iain

Thank you 

Below my syntax and that does not work : 

when custom field "Probable Start Date" is set to a date, set custom field "PROB MONTH" to "{{%Probable Start Date}~MM}", and set custom field "YTG Impact" to "13-{{%Prob Month}}"

 

I think I will go to the support but wanted to thank you 

0 votes
Answer accepted
Ludo
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 25, 2020

Hi

There is probably a syntax error.

Try this :

{{%FY}+1 - {%Prob Month}}

or {13 - {%Prob Month}}

or 13-({{%Prob Month}})

or ({{%FY}} - {{%Prob Month}})+1

Xavier Lecomte February 25, 2020

Thank you for the attempt. Unfortunately none of the above gives the expected result. Have you ever seen the arithmetic on Number  Custom Field Variables  working?  

Ludo
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 25, 2020

Not tested. But visibly it is possible. See this :

https://help.trello.com/article/1161-custom-field-arithmetic

https://help.trello.com/article/1159-arithmetic-in-date-variables

@Xavier Lecomte 

I just have tested this rules, and it works for me

when custom field "Date" is set, set custom field "n1" to "{{%Date}~MM}", and set custom field "n2" to "{{%n1}}+3"
when custom field "Date" is set, set custom field "n1" to "{{%Date}~MM}", and set custom field "n3" to "{{%n1}}+{{%n2}}+3"

 

Xavier Lecomte February 27, 2020

Hey Ludo 

Thank you 

Below my syntax and that does not work : 

when custom field "Probable Start Date" is set to a date, set custom field "PROB MONTH" to "{{%Probable Start Date}~MM}", and set custom field "YTG Impact" to "13-{{%Prob Month}}"

 

I think I will go to the support but wanted to thank you 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events