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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Index of last left zero in string

Colleagues, good day!

Some questions about string fuction Index...

I have simple table, which contain num and text values with leader zeros.

 

Test
006545
005
35
45
43
00fdfsdfsd
00yuturt
0665
0fdhfg00

I need to suppress them. My idea to use left function and index of last left zero.

How i can find this index in expr?

thanks.

1 Solution

Accepted Solutions
sunny_talwar

May be this:

=Mid(Test, FindOneOf(Test, 'abcdefghijklmnopqrstuvwxyz123456789'))


Capture.PNG

View solution in original post

8 Replies
sunny_talwar

May be this:

=Mid(Test, FindOneOf(Test, 'abcdefghijklmnopqrstuvwxyz123456789'))


Capture.PNG

Chanty4u
MVP
MVP

is this you need?

a:

LOAD * Inline

[

Test

006545

005

35

45

43

00fdfsdfsd

00yuturt

0665

0fdhfg00

];

LOAD *

,

PurgeChar(Test,'0') as newvalu

Resident a;resu.PNG

sunny_talwar

or this:

=Mid(Test, FindOneOf(Lower(Test), 'abcdefghijklmnopqrstuvwxyz123456789'))

sunny_talwar

This will remove any 0... I don't think this is what the OP wants

Anonymous
Not applicable
Author

Thanks)

Could you explain me please, how works this two functions?

Anonymous
Not applicable
Author

Thanks, but i need to remove only left zeros.

Anonymous
Not applicable
Author

yes)

sunny_talwar

FindOneOf will look for the first occurrence of the values supplied

FindOneOf(Test, 'abcdefghijklmnopqrstuvwxyz123456789')

Notice how I did not give 0 in the list. Once you know the location of the 1st non-zero number, you just use a Mid function where you tell where to start.