Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I am using a field called Domiciled Country where the values are as below.
I want to get inly the country name. i.e. Afghanistan
In this scenario how to use Sub field function.
Domiciled Country |
803;#Afghanistan |
824;#Bhutan |
825;#Bolivia |
what I want is as below.
Domiciled Country |
Afghanistan |
Bhutan |
Bolivia |
Please advise.
Thanks
Ashish
Hi,
Try like
subfield(Domiciled,'#',2)
Regards
Hi,
Try like
subfield(Domiciled,'#',2)
Regards
Hello!
May be more easy way is using function PurgeChar?
q1:
load
PurgeChar(Country,'0123456789;#') as CountryClear
Resident
Domiciled;
Hi,
try this:
subfield([Domiciled Country],';',1) as DomiciledCountryCode,
subfield([Domiciled Country],'#',2) as DomiciledCountry
Hope this helps
Tobias
Or try with SubField and alt function for when it's null in the first two cases, something like
Alt(subfield([Domiciled country],'#',2),[Domiciled country])
Thanks Max for your quick response.
it's working as expected.
Hi,
Please try the below script:
Tab1:
LOAD * INLINE [
Country
Domiciled
Country
803;#Afganistan
824;#Bhutan
825;#Bolvia
];
NoConcatenate
Tab2:
Load purgechar(Country,'0123456789;#') as Country Resident Tab1;
Drop table Tab1;