cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
greenawayr
Nintex Newbie

Calculated Values in Repeating Sections

Jump to solution

Hi All!

I've created a repeating with a number of calculated values inside. There's one with a lookup function that works fine, others maths calculations that work fine, and then one with an If function that checks whether a tick box is set to true, if it is it takes its value from field A, if its not it takes its value from field B!

This last one does not work.

If I remove it from the repeating section it does work, but then the control doesn't function properly as it's not scoped to the row that it belongs to, so if I add a second row and select my tick box it will take override the first row and my calculations will be wrong.

calculations are correct in this image with 1 row

Now with a second row my calculations go all crazy.

If I move the calculated value inside the repeating section it simply fails to update when the tick box "Override Markup" is selected and the markup will stay the same. The calculations are correct, but the user no longer has the ability to set their own markups.

My formula is 

If(Override Markup=="true", replace(New Markup,"[0-9]*]","", ""), replace(Markup, "[0-9]*]","", ""))

The replace function is in there because the values were being returned in [] suggesting that it was expecting an array, but it shouldn't have been. However, without the replace functions the issue still remains.

Any help really appreciated here.

Thanks

Labels: (2)
0 Kudos
Reply
5 Replies
MegaJerk
Nintex Newbie

Re: Calculated Values in Repeating Sections

Jump to solution

Looking only at the images you have provided, it is difficult to tell exactly what you are attempting to achieve, but let me take a stab. 

You mention a Field B, but never specify where it's located. Is it outside of the Repeating Section? Is the user setting a Form Wide Markup that should be applied whenever that box is checked? 

I also must assume that a default markup value, per the Repeating Section Row, is set based off of some other *thing* like the Category. 

Something like that is easily achievable: 
 

I just used the formula below in the 'Total With Markup' Calculated Control: 

If(Overide_Markup,(Cost*Qty) + ((Cost*Qty)*(Markup Override Value/100)),(Cost*Qty) + ((Cost*Qty)*(Markup/100)))

Because checkboxes are converted to boolean values, you don't need to write out 'Override_Markup == "true"'. Simply inserting the control as a reference will do the trick.

Is this about right? 

0 Kudos
Reply
greenawayr
Nintex Newbie

Re: Calculated Values in Repeating Sections

Jump to solution

Thanks. Although your mock up isn't exactly as I have (the New Markup value exists inside the repeating section and a different value can be applied to each row in the repeating section) simply removing the OverrideMarkup==true from my If statement got everything working.

It's odd as in theory 

If(OverrideMarkup==true...

and

If(OverrideMarkup...

should both resolve the same way but clearly not in this case.

Thanks for the pointer. Problem solved.

0 Kudos
Reply
emha
Nintex Newbie

Re: Calculated Values in Repeating Sections

Jump to solution

if you used expression: OverrideMarkup==true

then it would work, since you would compare two boolean values

if you however used expression: OverrideMarkup=="true"

you compared boolean value to a string value. non empty string value is always treated as (boolean) true

Reply
greenawayr
Nintex Newbie

Re: Calculated Values in Repeating Sections

Jump to solution

I just spotted that in my formula.I honestly don't know why that is in there.

I know that it's a boolean, not string. I blame parenthood and sleep deprivation!

Reply
emha
Nintex Newbie

Re: Calculated Values in Repeating Sections

Jump to solution

maybe you wanted to stress out it's really true?

0 Kudos
Reply