Formula Using a Variable

Hi there, Can someone please advise where my formula is incorrect? I have tried adding more brackets around each part, but this has not fixed the calculation. I think I must be missing something.

The formula seems to be ignoring the first part of the subtraction in the brackets:

Line_A21_SS_Spread

The actual result is only using the second part and multiplying it times the variable: Line_SS_Spread_Enter_Cup_Spread*#Waist_Length_Variable

I want it to subtract the 2 line values and take that result x the variable.

Complete formula:

(Line_A21_Enter_Cup_Spread)==(#DD_Spread)?(Line_A21_SS_Spread-Line_SS_Spread_Enter_Cup_Spread)#Waist_Length_Variable:(Line_A21_Enter_Cup_Spread)==(#D_Spread)?(Line_A21_SS_Spread-Line_SS_Spread_Enter_Cup_Spread)#Waist_Length_Variable:(Line_A21_Enter_Cup_Spread)==(#C_Spread)?(Line_A21_SS_Spread-Line_SS_Spread_Enter_Cup_Spread):(Line_A21_Enter_Cup_Spread)==(#B_Spread)?(Line_SS_Spread_Enter_Cup_Spread-Line_A21_SS_Spread)#Waist_Length_Variable:(Line_SS_Spread_Enter_Cup_Spread-Line_A21_SS_Spread)#Waist_Length_Variable

Thank you for your help,

Sandra

1 Like

Additionally, now I am getting a windows message that shuts down Seamly. I suspect it no longer likes the variable. I DL the current version of Seamly but it is still producing this error…

Sandra

1 Like

Just a note… when posting text that contains #'s put the text in a blockquote so the forums does not treat the text as code… in the case of what you posted it strips the *'s out.

You have to more or less follow c+ syntax. While not all the ()'s may be neccessary it won’t hurt to follow the format:

( A ) ? ( B ) : ( C)… where if A is true do B else do C

and if you’re going to nest you can replace B or C with another ternary in ()'s

( A ) ? (( D ) ? ( E ) : ( F )) : ( C ) where B is replaced with (D ? E : F)… where if A is true then do ( If D is true then E else F) else do C.

So looking at what you have:

(Line_A21_Enter_Cup_Spread)==(#DD_Spread)… the () are redundant as there’s notjing to calculate within the (), but if we follow the above:

A… (Line_A21_Enter_Cup_Spread == #DD_Spread)

Then we got:

B… ((Line_A21_SS_Spread - Line_SS_Spread_Enter_Cup_Spread) * #Waist_Length_Variable)

and then:

C… (Line_A21_Enter_Cup_Spread == #D_Spread)

After that it seems any nesting breaks down? Looks like you’re doing A ? B :C ? D : E ? F : G which I think is going to resolve as A ? B :(C ? D : (E ? F : G))

Hope this helps.

2 Likes

Hi Doug, sorry I caused confusion. I will try to do as you suggest in the future. I have it working now thank you. The breakdown in the last section is because those results are negative.

Sandra

2 Likes