Add the conditions as a preceding load statement.
If you have millions of values and you only want A, AA or AAA, I'd use:
If(Match(Abbreviation, 'A', 'AA', 'AAA'), 'x',) as Header3
to ensure you don't pick up any other values that could start with an A etc.
As stated in the other answers, your:
If(Len(Value)>0, 'x',) as Header4
should work. Combine them both in an if(... or...) statement to get Header5.