Update checkbox through calculated value based on fields in a related module

Hi There,

I am trying to get a checkbox in the accounts module (out_of_service) to show as checked if the cases module type is equal to "Out of Service" and the status is not "closed" using the calculated values in studio. I have tried the below but it is not working:

ifElse(and(equal(related($cases,"type"),"Out of Service"),not(equal(related($cases,"status"),"Closed"))),true,false)

Any suggestions would be greatly appreciated

Thanks in advance