Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
datanibbler
Champion
Champion

Keepchar() function - can I make that more precise?

Hi,

I have a keepchar() function in a formula I use to calculate a keyfield in one of my tables.

That encompasses two letters, "B" and "M" because some shelfs around here all start with "BM". There is, however, one that I do not want and that also has these two letters in the name - not right next to each other, but the KEEPCHAR() function does not by default recognize that.

=> Is there any way I can use that function (just that one, without combining it with any other (I will try that now)) that I can specify for the KEEPCHAR() function that I want to look for those two letters only if they are right next to each other?

Thanks a lot!

Best regards,

DataNibbler

1 Solution

Accepted Solutions
marcus_sommer

Hi DataNibbler,

a few from these string-examples would be helpful. But I doubt that there is a way with keep/purge-char functions and you will need other additionally functions like replace or left/right/mid with index or similar.

- Marcus

View solution in original post

2 Replies
marcus_sommer

Hi DataNibbler,

a few from these string-examples would be helpful. But I doubt that there is a way with keep/purge-char functions and you will need other additionally functions like replace or left/right/mid with index or similar.

- Marcus

datanibbler
Champion
Champion
Author

Hi Marcus,

I thought so. I will have to use INDEX() as that allows me to specify a string, consisting of several letters right next to each other. For now I use a simple LEFT() function in addition to what I had before as I know that those letters are always the very first in the name.