Problem with parameter to change the displayed data

Hello, I am trying to do a visual that dislpays A B and C according to certain rules and metric. I have two metrics: Tot and single.
This is the dataset and what I want to accomplish:
image
According to the number I have in the column 1 there will be A B or C in the third column, and the same in the second for the fourth.
this is the WORKING code I used to create this:

ifelse({abc packages}<10*(distinctCountOver({abc packages},[{customer_name}],PRE_FILTER))/100,'A',

{abc packages}>=10*(distinctCountOver({abc packages},[{customer_name}],PRE_FILTER))/100 AND {abc packages} <20*(distinctCountOver({abc packages},[{customer_name}],PRE_FILTER))/100,'B',

'C')

Then I create the switch to show the different data with the parameters like

ifelse(
        ${Granularity} = 'Total',{ orders tot},
        ${Granularity} = 'Client',{ orders},
        0)

Now the problem I have is that while the switch works for the the columns with the numbers, but it does not work if I use the calculated fields…it gives me

Is there something I am doing wrong? or I can not use this approach for strings values?
Thank you

I have found the problem…

since now the parameter would have been a string, I had to change the last 0 to ‘0’…