Expand my Community achievements bar.

SOLVED

Creating a Calculated field that use IF/Then display logic

Avatar

Level 3

looking to create a calculated field that displays the text from two other calculated fields.  However if both fields exist, default to only display the second field.

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

displaying the source data with an IF(ISBLANK( statement is doable. I don't know the order of calculations in a form but if the source fields aren't calculated first, your third calc field will be blank every time. I've never tried calculating two already calculated fields since I'm skeptical if it can even be done. You may have to recreate the calcs in those two fields into the third one instead of trying to calculate 2 calc fields.

If you do a standard CONCAT on a third field with no IF ELSE statement, does it work?

View solution in original post

5 Replies

Avatar

Community Advisor

Are the source calc fields on the same object or form? If so, you may run into the problem where your calc field won't display anything because your source fields haven't calculated yet.

Another consideration is that if your CONCAT is CONCAT(source1, source2) it will display only the second source if the first doesn't exist anyway!

I've never tried something like that but it sounds like a pretty high if not 100% failure rate.

 

Perhaps someone who's tried it can weigh in?

Avatar

Level 3

yeah source 1 is always going to exist, but if source 2 exist, I would like for the code/formula to disregard the first source and only display  the second.  Hopefully that makes more sense.  Both source fields will live on different forms but at the project level.

 

Avatar

Correct answer by
Community Advisor

displaying the source data with an IF(ISBLANK( statement is doable. I don't know the order of calculations in a form but if the source fields aren't calculated first, your third calc field will be blank every time. I've never tried calculating two already calculated fields since I'm skeptical if it can even be done. You may have to recreate the calcs in those two fields into the third one instead of trying to calculate 2 calc fields.

If you do a standard CONCAT on a third field with no IF ELSE statement, does it work?

Avatar

Community Advisor

yep, if it's gonna work with calc fields as sources, that should do it.