The return key and space bar can help make case functions easier to read an analyze. The following format will work directly in your specify calculation dialog. But what you are trying to do with your quoted result expressions is not at all clear to me.
Case ( ImmediateStart = "Yes"; "P1 - Immediate Start";
Category = "5a" ; "P2 - 5a ";
Category = "5i" ; "P3 - 5i ";
GetAsNumber ( Category ) = 5 ; "P4 - Remaining Category 5 ";
GetAsNumber ( Category ) = 4 ; "P5 - Category 4's"
) // case
You can omit the and ImmediateStart = "No" terms since if immediateStart is "yes", the very first result text: "P1 - Immediate Start" will be returned and none of the following comparison expresions (boolean expressions) will be evaluated. GetAsNumber will strip off all the following non-numeric characters and evaluate the field as a number to compare to 4 or 5 in the last two Boolean expressions.
Left ( Category ; 1 ) = 5 might also work if only single digit numbers are possible for your values in Category.
Basically there can be any of the following Categories: 5a, 5h, 5i, 5s, 4a, 4b, 4h, 4m, 4s.
There also can be any of those above categories that are identified as an immediate start. So a 5a can be an immediate start.
The immediate start field would be a priority over the 5a category which is why I thought I had to say if immediatestart=no in all the other ones. Joy if I don't have to add that extra text.
But as you can see although there are multiple categories for both 4's and 5's, they only want to single out the category 5a, 5i and the other 5's can be grouped and all 4's can be grouped.
So does this calculation work for you?
I just tried it and it seems to work fine thanks very much for that!