Why does my variable always equal 755?

:bullseye: What is your goal?

To have a function that can calculate the total, depending on the answers to the different options that I provide potential participants with.

I hope a kind soul will be able to help a coding beginner here :slight_smile:

:thinking: What is the problem & what have you tried?

My variable always equals 755, no matter whether the participant answers “no” to every extra option, or yes. Saying no to everything should total 495, and saying yes to everything should equal 1060. What I’ve figured out, is that the 3 first orange options are always added, whilst the 2 last ones are never added.

:camera_with_flash: Screenshots (scenario flow, module settings, errors)

try this

{{495
+ if(contains(trim(upper(6.tilvalg1)); "NEJ TAK"); 0; 180)
+ if(contains(trim(upper(6.tilvalg2_navn)); "NEJ"); 0; 40)
+ if(contains(trim(upper(6.tilvalg4_nummer)); "NEJ"); 0; 40)
+ if(contains(trim(upper(6.camp_torsdag)); "JA"); 125; 0)
+ if(contains(trim(upper(6.frokost)); "JA TAK"); 180; 0)
}}
1 Like

Yeah Make doesn’t need the double quotes unless they are actually in the variable.

You’re a hero! Thank you so much :slight_smile:

2 Likes