Discussion board where members can get started with Qlik Sense.
I'm new to Qlik and I have a rookie problem.
I need to replace some values of a field, the obvious answer is to replace it on the Data Manager, but my Field has more than 100 values.
Is there any code I can use to do it when I load the original data?
What do you mean by "replace" and "100 values"? Can you give us an example?
You might be able to do something like this if you are just removing a bad value.
If( SomeValue = 'Bad', 'Now Good', SomeValue ) AS 'CleanedValue'
LOAD * Inline
I have a field with 179 names, some names are for the same people so for example:
John Winston Ono Lenon
John W. Lennon
All those names I'd like to have them as 'John Lennon'. The ideal way is to go to the Data Editor and use the replace function, but as I have more than 100 names I can't do that.
Hope I'm clear this time....
You can still use the techniques that Sunny and Justin told you about. You just have to repeat the to-name for each of the from-names in the mapping table (translation table).
May be like this:
If(Match(Field,'John L','J Lennon','John Winston Ono Lenon','John W. Lennon'),'John Lennon',
If(Match(Field,'John R','J Rennon','John Winston Ono Renon','John W. Rennon'),'John Rennon', 'ABC'))
By using of Match(), MixMatch() functions.
Because one name is having 3 or 4 similar names.
Finally used @Bala's answer.
If(Match(Field,'John L','J Lennon','John Winston Ono Lenon','John W. Lennon'),'John Lennon',Field)
Only repeated the field at the end so the rest of the values (the ones not changed) remain as the original Field.