Expand/Collapse all
KeepChar - script and chart functionON THIS PAGE
KeepChar() returns a string consisting of the first string ,'text', less any of the characters NOT contained in the second string, "keep_chars".
Syntax:
KeepChar( text, keep_chars)
Return data type: string
Arguments:
Arguments
text
The original string.
keep_chars
A string containing the characters in text to be kept.
Example: Chart expressions
KeepChar
( 'a1b2c3','123' )
Returns '123'.
KeepChar
( 'a1b2c3','1234' )
Returns '123'.
KeepChar
( 'a1b22c3','1234' )
Returns '1223'.
KeepChar
( 'a1b2c3','312' )
Returns '123'.
Example: Load script and results
T1:
Load
*,
keepchar(String1, String2) as KeepChar;
Load * inline [
String1, String2
'a1b2c3', '123'
];
Copy code to clipboard
Results
Qlik Sense table showing the output from using the KeepChar function in the load script.
String1
String2
KeepChar
a1b2c3
123
123