Select to view content in your preferred language

Is there a way to use the coalesce calculation with more than 2 fields?

903
1
Jump to solution
06-27-2023 05:44 AM
SeanNagy1
Regular Contributor

I have 8 fields that can possibly be filled with data. I want to grab data from the last field that has data and the coalesce function seems to be the best way to do that but it only works with 2 fields. Is there anyway to do that calculation with more than 2 fields?

1 Solution

Accepted Solutions
fklotz
by
Regular Contributor

You can nest the coalesce functions, ensuring that your brackets are all closed and the values are listed in reverse order so that they are checked for values in the order you stated in the question.

fklotz_0-1687870873756.png

 

coalesce(${TestArea8}, coalesce(${TestArea7}, coalesce(${TestArea6}, coalesce(${TestArea5}, coalesce(${TestArea4}, coalesce(${TestArea3}, coalesce(${TestArea2},${TestArea1})))))))

 

 

 

Farley

View solution in original post

1 Reply
fklotz
by
Regular Contributor

You can nest the coalesce functions, ensuring that your brackets are all closed and the values are listed in reverse order so that they are checked for values in the order you stated in the question.

fklotz_0-1687870873756.png

 

coalesce(${TestArea8}, coalesce(${TestArea7}, coalesce(${TestArea6}, coalesce(${TestArea5}, coalesce(${TestArea4}, coalesce(${TestArea3}, coalesce(${TestArea2},${TestArea1})))))))

 

 

 

Farley