Forum Discussion

Cadu's avatar
Cadu
Regular Visitor
3 years ago
Solved

Cannot convert value 'Occupation' of type Text to type True/False.

Hi, I have writen this new column and it returns the error: Cannot convert value 'Occupation' of type Text to type True/False.
Does someone know how to solve it?
New column =
(IF(OR
(ISBLANK(FACT_V[ROLE]),
FACT_V[ROLE]=""),RELATED(FACT_E[Roles]),
IF(RELATED(DIM_B[Occupation]),(FACT_V[ROLE]
))))
  • I believe it is because of this part: "IF(RELATED(DIM_B[Occupation])," since the first argument of an if statement should be a logical test.

2 Replies

  • I believe it is because of this part: "IF(RELATED(DIM_B[Occupation])," since the first argument of an if statement should be a logical test.

  • KNP's avatar
    KNP
    Icon for Super User rankSuper User

    Formatting the code would certainly make it easier to help. I think JorgePinho is right about the bit he's highlighted, what were you expecting that to do/test for?

    Consider using a SWITCH statement instead of nested IFs. It can make the logic much simpler.