How can i change a returned value based on condition

I have some docs which have some data inconsistency, there is a key called occupied in my doc which in most cases has
either an A or O and sometimes an E as a value. Then a small % has a 1 or a 0 as value. What i would like to do is to go and have my N1QL query modify the returned value so if its an A , O or E i will return that for occupied, but if it is 0 i want to return a A and if its a 1 i want to return a O. What is the best aproach to do this ? With If or switch ?

you can use CASE expression