Hi there,
i would like to replace some of the values in one of my tables when i load the script with an if statement.
It seems that my syntax is not correct. I want to replace France with FR.
The field i am loading is [CountryregionID]
If it does not find France it should load the rest of values as is.
Best regards,
Lawrence
Hi Lawrence,
Load
Fields1, Field 2, ... if( Upper(CountryregionID) = 'FRANCE', 'FR', CountryregionID ) as CountryregionID,
Field N, .... ;
Upper(CountryregionID) comparison will be taken care of france, France, FRANCE
Thanks,
Prashanth Reddy D.
Hi Lawrence,
Load
Fields1, Field 2, ... if( Upper(CountryregionID) = 'FRANCE', 'FR', CountryregionID ) as CountryregionID,
Field N, .... ;
Upper(CountryregionID) comparison will be taken care of france, France, FRANCE
Thanks,
Prashanth Reddy D.
Hi Lawrence,
How do I replace/change values under a column while loading data?
This may helps.
Regards,
Sadasiva
Or
...
If(CountryregionID Like 'FRANCE', 'FR', CountryregionID) as CountryregionID,
...
Thank you for your replies.
I have a question regarding the country names. In my data the names are in french and i have a KML file with the ISO2 code. If i need to translate all the country data i will need almost 200 consequent if statements. Is there a fastest way to do this?
Best regards,
Lawrence
I'm assuming that your country names are of length greater than 2 and ISO
coded are of length 2. In such case, you can write as..
If(Len(Countryname)>2, ISOCode, Countryname)
Slightly you can alter as per your lengths.
On Aug 10, 2017 20:43, "Lawrence Tzigersizoglou" <qcwebmaster@qlikview.com>