Structure formula returning Div/0

Umesh Kulkarni July 7, 2024

Hello,

i have calculated the difference  ( say LeadTime) in when an issue was approved and when it was marked done.  the total of diff is calculated at the parent level

second, i have counted (say noOfIssues) the number of issues which aware approved and marked done in a month. the total count is calculated at parent level

 

Now, i just want to divide LeadTime/noOfIssues and it is giving me div/0

i have already made sure to check that noOfIssues > 0, i have made sure that all of these variables are numbers

I have also separately calculated each of the number and it works fine. also LeadTime - noOFIssues works fine, LeadTime + noOfIssues works fine it is just the division that is not  working as expected.

 

Any help is much appreciated.

 

 

image.pngimage.png

 

3 answers

1 accepted

Suggest an answer

Log in or Sign up to answer
0 votes
Answer accepted
Umesh Kulkarni September 21, 2024

Problem - If you remove the option “sum over subitems“ from the Lead Time formula, there will be no value on the folder level. For the formula, we would need to use the actual function to bring the value to that level.

Solution as suggested by the support team and worked:

So, instead of  - 

IF noOfIssues: LeadTime / noOfIssues

USE

WITH leadTime = SUM#subtree{

if resolved >0: 
    if resolved >0: 
        ((resolved - caraprtval)/86400000)/1
}:
leadTime/count123
1 vote
Stepan Kholodov _Tempo_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 8, 2024

Hello @Umesh Kulkarni 

With cropped screenshots it's hard to say anything for certain, but one of the possible reasons for the Formula to consider 0 is the noOfissues value you want to use is aggregated. I.e. if 12 is not an individual value, but a value summed up from sub-issues using the 'Sum over sub-items' option in the column that is being referenced in the end Formula column. If this is the case, then try using sum{noOfissues} in the end formula instead of noOfissues

I hope this helps. If you need further assistance with the formula or if you have other questions about Structure, please reach out to us directly at our support portal.

Best regards,
Stepan
Tempo (the Structure app vendor)

0 votes
Bill Sheboy
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.
July 7, 2024

Hi @Umesh Kulkarni -- Welcome to the Atlassian Community!

First thing, I am not currently using Structure and so my suggestions are based on what I recall.  With that out of the way...

Have you tried adding a conditional to confirm the formula is detecting a non-empty value?  Perhaps like this:

IF noOfIssues: LeadTime / noOfIssues

 

Kind regards,
Bill

Umesh Kulkarni July 7, 2024

Hello Bill,

Thanks for the suggestion

I have given it a try, now it shows 0 with your suggestion while it should have shown 17 (with no decimals)

 

Bill Sheboy
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.
July 7, 2024

For that expression, I believe that is the behavior when it detects noOfIssues is either 0 or empty, the same as this:

noOfIssues AND LeadTime / noOfIssues

If you replace the formula with just noOfIssues does it return what you expected or 0?  That may narrow down if it is finding another value, or if the value is not yet set when the division is attempted.

Umesh Kulkarni July 7, 2024

 

Hello Bill,

Thanks for checking further.

Yes, if i just put noOfIssues then it does return non zero value (here in this case 12)

Not getting, why it considers 0 when used in a formula  - 

IF noOfIssues: LeadTime / noOfIssues

image.png

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events