0% found this document useful (0 votes)
39 views11 pages

String Function That Can Save Effort and Time

This document provides a summary of string functions in Qlik, including INDEX, REPEAT, UPPER, LOWER, CAPITALIZE, MID, LEFT, RIGHT, TRIM, LTRIM, RTRIM, KEEPCHAR, PURGECHAR, LEN, and TEXTBETWEEN. Each function is described in 1-2 sentences and an example is provided to demonstrate usage and output. The document encourages readers to share their own experiences with these string functions in Qlik in the comments.

Uploaded by

Saso Nikolovski
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
39 views11 pages

String Function That Can Save Effort and Time

This document provides a summary of string functions in Qlik, including INDEX, REPEAT, UPPER, LOWER, CAPITALIZE, MID, LEFT, RIGHT, TRIM, LTRIM, RTRIM, KEEPCHAR, PURGECHAR, LEN, and TEXTBETWEEN. Each function is described in 1-2 sentences and an example is provided to demonstrate usage and output. The document encourages readers to share their own experiences with these string functions in Qlik in the comments.

Uploaded by

Saso Nikolovski
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 11

String

Functions
With Examples

Qlik
1 index(s1 , s2 [ , n] )
Returns The Starting Position Of The First
index(s1 , s2)
Occurrence Of Substring s2 In String s1.

index('QlikSenseSense , 'Se') 5

Returns The Starting Position Of The n’th


index(s1 , s2 [ , n] )
Occurrence Of Substring s2 In String s1.

index('QlikSenseSense', 'Se' ,2) 10

A Negative n Searches From The End Of


index(s1 , s2 [ , -n] ) The String.

index('QlikSenseSense', 'Se‘ , -2) 5


index('QlikSenseSense', 'Se‘ , -1) 10
2 Repeat( s, n)

Creates A New String By Repeating The Input String s


A Total Of n Times.

Repeat( '*', 4 ) ****


Repeat( 'Sense', 2 ) SenseSense

Qlik
Capitalize(s) , UPPER(s),
3 lower(s)

UPPER('qlik sense') QLIK SENSE

lower('Qlik Sense') qlik sense

Capitalize('qlik sense') Qlik Sense

Qlik
4 Mid(s, n1 [, n2])
Mid(s, n1) Returns The Part Of The String s Starting
Mid(s, n1) At Position n1 Until The End Of The String s.

Mid('Qlik Sense', 5) Sense

n2 Defines The String Length Of The Output


Mid(s, n1 [, n2])
String.

Mid('Qlik Sense', 1, 4) Qlik


5 Left(s , n) & Right(s , n)
Returns The First n Characters Of The Input
Left(s, n) String s.

Left('Qlik Sense' , 7 ) Qlik Se


Left(' Qlik Sense' , 7 ) Qlik S

Returns The Last n Characters Of The Input


Right(s , n) String s.

Right('Qlik Sense' , 5 ) Sense


Right('Qlik Sense ‚ 5 ) ense
6 Trim(s), Ltrim(s), Rtrim(s)

Ltrim(s) Removes Leading Spaces From A String s.

Ltrim(' Qlik Sense ') Qlik Sense '

Rtrim(s) Removes Trailing Spaces From A String s.

Rtrim(' Qlik Sense ') Qlik Sense

Trim(s) Removes Leading And Trailing Spaces From A String


s.

Trim(' Qlik Sense ') Qlik Sense


7 KeepChar(s1,s2), PurgeChar(s1,s2)

Returns A String Containing Only


KeepChar (s1,s2) Characters Present In The s2.
! It’s Case Sensitive!

KeepChar('A1B2c3d4', 'ABcd') ABcd


KeepChar('A1B2c3d4', 'abcd') cd
KeepChar('A1B2c3d4', '1234') 1234

Returns A String Excluding


PurgeChar (s1,s2) Characters Present In The s2.
! It’s Case Sensitive!

PurgeChar('A1B2c3d4', 'ABcd') 1234


PurgeChar('A1B2c3d4', 'abcd') A1B234
PurgeChar('A1B2c3d4', '1234') ABcd
8 Len(s)

Len(s) Returns The Length Of The String.

Len('Qlik') 4
Len(' Qlik') 5
Len(' Qlik ') 6

Qlik
9 TextBetween(s , beforetext , aftertext [, n ])

Returns The Text In The Input


TextBetween(s , before , after) String s That Occurs Between The
delimeters.

TextBetween( '[Qlik] Sense' , '[' , ']' ) Qlik


TextBetween( '[Qlik] [Sense]' , '[' , ']' ) Qlik

n specifies which occurrence of the


TextBetween (s , before , after [, n ]) substring between the delimiters to
return.

Textbetween( '[Qlik] [Sense]' , '[' , ']' , 1 ) Qlik


Textbetween( '[Qlik] [Sense]' , '[' , ']' , 2) Sense
Feel Free To Share Your
Own Experiences In The
Comments Section.

@Abdulhasib_Masri

You might also like