KeepChar - 脚本和图表函数
KeepChar() returns a string consisting of the first string ,'text', less any of the characters NOT contained in the second string, "keep_chars".
语法:
KeepChar(text, keep_chars)
返回数据类型: 字符串
参数:
参数
text
|
原始字符串。 |
keep_chars
|
包含 text 中要保留的字符的字符串。 |
KeepChar ( 'a1b2c3','123' ) | Returns '123'. |
KeepChar ( 'a1b2c3','1234' ) | Returns '123'. |
KeepChar ( 'a1b22c3','1234' ) | Returns '1223'. |
KeepChar ( 'a1b2c3','312' ) | Returns '123'. |
T1:
Load
*,
keepchar(String1, String2) as KeepChar;
Load * inline [
String1, String2
'a1b2c3', '123'
];
结果
Qlik Sense 表显示了在加载脚本中使用 KeepChar 函数的输出。 String1 | String2 | KeepChar |
---|
a1b2c3 | 123 | 123 |