I have a query that returns’s, amongst other things, the following

I need something that will create a new column that will return 1 if level 1 is null, 2 if level 2 is null and 3 if level 3 is null (there coould be up to 5 levels)
I have no idea where to start with this one so any help would be greatly appreciated.
You should use Case when to decide the new column value.
Please see the following sample pl/sql code which will achieve what you want.
Now use the below query to achieve the new column value.