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

Announcements
Posting on Qlik Community is temporarily paused. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Replacing characters in field

Hi

I understand the concept of using subfield to help showing or hiding characters.

I have a bit more tricky  one

Say I have the follwing

1223867hrg.h345#IWantToSeeThisOnly#

what would be the best way to only see everything between the two # characters

Labels (1)
6 Replies
sunny_talwar
MVP
MVP

May be try TextBetween() here:

TextBetween('1223867hrg.h345#IWantToSeeThisOnly#', '#', '#')


Capture.PNG

Not applicable
Author

Thanks works well, but it you have 50 of these in a column, in one row the # is character 4, and in another its character 30 in the fields

sunny_talwar
MVP
MVP

I don't think distance between #s make any difference. Its just picking up everything between the two #s

sunny_talwar
MVP
MVP

If you want to do this on a field, you just need this:

TextBetween(FieldName, '#', '#') as NewFieldName

sunny_talwar
MVP
MVP

Have a look at this script:

Table:

LOAD *,

  TextBetween(FieldName, '#', '#') as NewFieldName;

LOAD * Inline [

FieldName

1223867hrg.h345#IWantToSeeThisOnly#

1asadasfscvtgsdfsfsd223867hrg.h345#AndThis#

1223867hrg.h345#MaybeTHIS#aDASDFSADFASFASDAS

ADASDADASDAFASCFSFG1223867hrg.h345#Alrightletsgetthistoo#SFASFASFASFSA

ADADWEFRVjgsfshfgkjerghcuiahnuifajfgweuifbajksdfgasfhasklfhalscnuekdhjhf1223867hrg.h345#Justonelast#gdasjdgajfgakfga

];


Capture.PNG

Not applicable
Author

Thanks. I will try this and let you know