• Resolved jamesradcliffe

    (@jamesradcliffe)


    I’ve been trying to work out how to use choice values from the dropdown menus in equations in the calculated field.

    I saw a previous post mentioning this can be done through the getField function but I didn’t fully understand it. Could someone please explain to me how this works?

    Thanks.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @jamesradcliffe

    If you want to use the value of the choice selected in the DropDown field in the equations, you simply should to use the field’s name.

    For example, assuming you have the DropDown field: fieldname1, and you want duplicate its value through the equation associated to the calculated field, the equation would be simply:

    fieldname1*2

    and that’s all.

    Best regards.

    Thread Starter jamesradcliffe

    (@jamesradcliffe)

    Sorry I forgot to mention that in the dropdown menu, I want to display the text associated with the value, but then use the value within the calculation.

    Say for example someone selected apples, this would have a value of 2 and then the used in further calculations.

    Does this follow the same method? As it doesn’t appear to be working for me although I may have done something else incorrectly.

    Plugin Author codepeople

    (@codepeople)

    Hello @jamesradcliffe

    Yes, in the equations are used always the values associated to the choices, and not their texts.

    Best regards.

    Thread Starter jamesradcliffe

    (@jamesradcliffe)

    Hi @codepeople sorry again,

    I’ve realised that my issue is with nested IF formulas, a single equation works for me but when I attempt to use multiple in the same equation I am unable to get a result.

    Is there a method to getting this to work or is the plugin unable to handle this?

    Thanks again.

    Plugin Author codepeople

    (@codepeople)

    Hello @jamesradcliffe

    Please, include your equation to check it.

    Best regards.

    Thread Starter jamesradcliffe

    (@jamesradcliffe)

    The equation works for me in excel but can’t seem to get it working here.

    IF(fieldname11>=5,0.1,IF(fieldname11=4,0.2,IF(fieldname11=3,0.4,IF(fieldname11=2,0.6,IF(fieldname11=1,0.8,IF(fieldname11=0,1,IF(fieldname11=-1,0.9,IF(fieldname11=2,0.8,IF(fieldname11=-2,0.8,IF(fieldname11=-3,0.7,IF(fieldname11=-4,0.6,IF(fieldname11=-5,0.5,IF(fieldname11=-6,0.4,IF(fieldname11=-7,0.3,IF(fieldname11=-8,0.2,IF(fieldname11<=-9,0.1,0))))))))))))))))

    Plugin Author codepeople

    (@codepeople)

    Hello @jamesradcliffe

    In javascript the operator for equality is the double symbol == because the symbol = is used for assignment.

    Best regards.

    Thread Starter jamesradcliffe

    (@jamesradcliffe)

    Thank you so much, working perfectly now!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Using Choice Values in Calculations?’ is closed to new replies.