Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld 2022, LIVE in Denver CO., May 16-19, 2022. REGISTER NOW TO RECEIVE EARLY BIRD PRICING
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

6 Replies
sunny_talwar

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

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

sunny_talwar

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

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

sunny_talwar

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