Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Qlikers,
I would like to know if there is a way to replace partialy some field values. Let say I have a column A that I load, but during load if the value is like '*test*' then "test" hase to be replaced by "OK".
LOAD
if (A like '*test*', ...'OK'... ) AS A
From...
So if value is " this is a test" I would like to have the following result: "this is a OK"
Thanks for your help
Hi Xavier,
check out the replace function as shown below
Andy
Replace() returns a string after replacing all occurrences of a given substring within the input string with another substring. The function is non-recursive and works from left to right.
Syntax:
Replace(text, from_str, to_str)
Return data type: string
Arguments:
Argument | Description |
---|---|
text | The original string. |
from_str | A string which may occur one or more times within the input string text. |
to_str | The string that will replace all occurrences of from_str within the string text. |
Hi Xavier,
check out the replace function as shown below
Andy
Replace() returns a string after replacing all occurrences of a given substring within the input string with another substring. The function is non-recursive and works from left to right.
Syntax:
Replace(text, from_str, to_str)
Return data type: string
Arguments:
Argument | Description |
---|---|
text | The original string. |
from_str | A string which may occur one or more times within the input string text. |
to_str | The string that will replace all occurrences of from_str within the string text. |
may be this?
Replace(FieldName, 'test', 'OK')
Hi,
You can also look the mapping function.
Mapping functions like "Apply Map" and "MapSubstring" will be used to replace whole or part of the word with new word.
Look at the Help content for detail information and example.
Regards,
Kaushik Solanki
A Mapping Table & ApplyMap is the best option.
This blog shows how to use ApplyMap Don't join - use Applymap instead
Great! the replace function worked perfectly.