Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Truncate string

Hi

I'd like to use a truncation function on a string. I can't find any documentation about string functions here, can someone help me ?

Regards,

1 Solution

Accepted Solutions
Not applicable
Author

Hi,

As i remember, Truncat function return the first characters of a string. So i think that the "left" function could do it.

Help information for this function :

left( s , n )

Substring of the string s. The result is a string consisting of the first n characters of s.

Examples:

left( 'abcdef',3 ) returns 'abc'.

left( Date, 4 ) where Date = 1997-07-14 returns 1997.

For a more complicated example, see the index function below.

Maxime S.

View solution in original post

4 Replies
Not applicable
Author

Hi,

In the help you can find about the string functions

In portuguese I don't find nothing, but in english (English.chm) have the documentation.

Not applicable
Author

Hi,

As i remember, Truncat function return the first characters of a string. So i think that the "left" function could do it.

Help information for this function :

left( s , n )

Substring of the string s. The result is a string consisting of the first n characters of s.

Examples:

left( 'abcdef',3 ) returns 'abc'.

left( Date, 4 ) where Date = 1997-07-14 returns 1997.

For a more complicated example, see the index function below.

Maxime S.

Not applicable
Author

thanks, left() is the one i picked up

Not applicable
Author

Here are some examples:

string = 12345|67890

left(string, index(string, '|') -1) returns 12345

mid(string, index(string, '|') + 1) returns 67890 (if you leave the third argument out, it returns the rest of the string)