have you tried create a calculation field like
if [Country] = 'AB' then
elseif [Country] = 'CD' then
elseif [Country] = 'DE' then
With cube data source ,it is not possible to write it like this.We have to use MDX script here
so why not create a new measure in the cube rather than in Tableau?
That is the final and easiest option to achieve this.Mean time looking for a mdx script for the same
Tableau doesn't work very well with cube...