I'm not sure where the 1's and 0's are coming from, but ultimately the expression would be the same. If you only have 1's and 0's you could add a calculated dimension (right click->properties->dimensions tab) and write in:
=if([Field] = 1, 'a','b')
where field is the data comprised of 1's and 0's.
I think that should get you your desired results.
Hope this helps!