Forum Discussion
[Expression.Error] We cannot convert the value null to type Logical.
- Anonymous5 years ago
null values can trip you up when used in if statements, and also with equality operators. I would try:
each if [startdate] = null then "" else if [enddate] = null then "" else if [active] = "1" and [live] = "1" and [latest] = "Green" and [startdate] > #date(2020,3,31) and [enddate] < #date(2021,4,1) then "FY21" else ""
--Nate
I had the same issue and none of the other answers online solved it. This worked for me:
My initial conditional column (or formula) had specific tests to return different specific values for faculty, such as "Faculty-Research", "Faculty-Visiting" etc. based on the Rank Title field and then a catch-all Else clause to return "Staff" for all other values. The problem was that the staff had null values for Rank Title and the formula did not know how to deal with that (I thought the else clause would have taken care of them, but it did not). So my solution was to use: if Rank Title equals null Then "Staff" as the first clause (getting rid of the issue at the beginning of the formula instead of trying to cover it with the Else clause at the end).
It also might work to change all the null values in Rank Title to "".