Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

String Format

Hi

I have a column where the values are like the ones below.

SAP_BW.png

I only want the number part, ex. 0000161677. What function or expression should I use to achieve this?

Thanks!

1 Solution

Accepted Solutions
marcus_sommer

For this you could use:

textbetween(YourFieldName, '[', ']', 2)

- Marcus

View solution in original post

6 Replies
nagaiank
Specialist III
Specialist III

You may use

Replace(Replace(SubField(YourFieldName,',',2),'[',''),']','')

Anonymous
Not applicable
Author

Hi

Thanks for replying. However, the expression is not working.

SAP_BW.png

marcus_sommer

For this you could use:

textbetween(YourFieldName, '[', ']', 2)

- Marcus

Not applicable
Author

what about rmid(fieldname, 13,10)

If I counted correctly, it would start on the 13th position for the next 10

mid(s, n1[, n2 ])

Substring of the string s. The result is the string starting at character n1 with the length of n2 characters. If n2 is omitted, the function returns the rightmost part of the string starting at character n1. The positions in the string are numbered from 1 and up.

Example:

mid('abcdef',3 ) returns 'cdef'.

mid('abcdef',3, 2 ) returns 'cd'.

mid( Date,3 ) where Date = 970714 returns 0714.

mid( Date,3,2 ) where Date = 970714 returns 07.

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

maxgro
MVP
MVP

could you post some data?

Anonymous
Not applicable
Author

Thank you!