Looking Custom form Calculated Field Suggestion? | Community
Skip to main content
Kundanism
Level 10
December 13, 2021
Solved

Looking Custom form Calculated Field Suggestion?

  • December 13, 2021
  • 1 reply
  • 627 views

HI,

I created a calculated field, but then I have to select one of them from field name DSC11 or DSC12. But how to implement in calculated field.

Possible to add only one field either from DSC11 or DSC12 selected and calculated here?

I am not such good in writing calculated expressions.

A screenshot view is attached here for your reference.

Mvh

kundan

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by ChloeRo

Hi Kundan!

The outputs for DSC11 & DSC12 are strings, not integers. So if you wanted to extract a number from those fields, are you just wanting to capture the first number in the selection? So if someone selects "5 - For value more than...", you'd want the sum to capture the value "5" and then add that to the rest of the formula, correct?

If that's the case, I'd recommend seeing if the following would return a value:

SUM(DSC1,DSC2,DSC3,DSC4,DSC5,DSC6,DSC7,DSC8,DSC9,DSC10,IF(ISBLANK(DSC11)&&ISBLANK(DSC12),0,IF(ISBLANK(DSC11),NUMBER(LEFT(DSC12,1)),NUMBER(LEFT(DSC11,1)))))

The "IF" statements first checks to make sure that there's a value in one of the fields - if no value is found, it returns "0". From there, it tries to configure a value for the option selected, by grabbing the first LEFT character of the selection, then forcing it into a NUMBER.

I tried to test the formula in our own environment but we don't have any fields where the selections begin with a value, so I figured it might be easier to just have you test it and we can troubleshoot from there.

1 reply

ChloeRoAccepted solution
Level 4
December 13, 2021

Hi Kundan!

The outputs for DSC11 & DSC12 are strings, not integers. So if you wanted to extract a number from those fields, are you just wanting to capture the first number in the selection? So if someone selects "5 - For value more than...", you'd want the sum to capture the value "5" and then add that to the rest of the formula, correct?

If that's the case, I'd recommend seeing if the following would return a value:

SUM(DSC1,DSC2,DSC3,DSC4,DSC5,DSC6,DSC7,DSC8,DSC9,DSC10,IF(ISBLANK(DSC11)&&ISBLANK(DSC12),0,IF(ISBLANK(DSC11),NUMBER(LEFT(DSC12,1)),NUMBER(LEFT(DSC11,1)))))

The "IF" statements first checks to make sure that there's a value in one of the fields - if no value is found, it returns "0". From there, it tries to configure a value for the option selected, by grabbing the first LEFT character of the selection, then forcing it into a NUMBER.

I tried to test the formula in our own environment but we don't have any fields where the selections begin with a value, so I figured it might be easier to just have you test it and we can troubleshoot from there.

Kundanism
KundanismAuthor
Level 10
December 20, 2021

Thanks a lot @Chloe Rock‚

I will refer your recommendation and come back to you.

Have a nice day!

Mvh

Kundan,.