Issue with formula

One more topic. It’s look like there is bug in formulas / logic function.

When I use conditions in the logic, I find that if I disable show (show if is /not) a variable in the settings, the final formula does not insert that variable into the calculation. In other words, I would need the variable to be valid even if it is not displayed in survey. Or create a sub-function in the logic that gives the user the option to include/reject the input variable in the formula. I hope I explained well.

1 Like

Hi there, @Martin.Kasos :wave:

You’d like to include the field in the calculation even if it was hidden with a conditional logic, right?

If this is the case, what value for this field should be added to the calculation if you haven’t chosen anything. Could you please elaborate on your use case and share an example where you’d like to implement it?

Hi Max,
Yes, you are right. Basically is problem when I need more complex formulas for fine pricing (see my unfinished calculator)

https://598c7550e325410387b95e7d745e8e71.elf.site

I need a few steps(slides) to get information from customer and hide up someone during the process of calculation:

Right now I’ve solved this problem with IF function and this way:

Formula: (G) Základní sazba:

if(03. Potřebujete pravidelný úklid?==1,ROUND(01. Co potřebujete uklidit?*02. Jak jste flexibilní v plánování?*04. Jak často potřebujete úklid?),ROUND(01. Co potřebujete uklidit?*02. Jak jste flexibilní v plánování?+2))

Formula: (G) Základní sazba:
if({{m8nyic6c}}==1,ROUND({{m8nye298}}{{zl0k0bl7}}{{m8nyoi05}}),ROUND({{m8nye298}}*{{zl0k0bl7}}+2))

Maybe you’ve got a better solutio. But basically the idea is that a variable enters the formula and is not allowed in the logic, so it is probably replaced by zero and so the formula stops working and shows zero as the result. I have formulas with multiples as coefficients so I haven’t tested with sums yet. However, I think it’s more of a dysfunction if I understand working with formulas correctly and have the correct formula construction.

Thx a lot. Mar

1 Like

Thank you!

If a specific field is included in the formula, but is hidden with the conditional logic, the widget doesn’t get any value for this field, that’s why zero value is used for this field in the formula. So, this is a correct behavior, but not the issue.

Your solution is correct and this is the only workaround in this case.

Please let me know if this explains things or if you have any questions left :slightly_smiling_face: