Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
brijeshvma
Partner - Creator
Partner - Creator

how to get part of string

Hi all

I have a Value like

in_bu_re_estate_agra_uttar_pradesh ,

in_bu_re_estate_mumbai

in_bu_re_estate_delhi

in_bu_re_estate_bilaspur_chattisgarh_india


So i want to get seperate column having Data like

agra_uttar_pradesh,

mumbai,

delhi,

bilaspur_chattisgarh_india





Kindly hele me for the same..



1 Solution

Accepted Solutions
sunny_talwar

May be this:

Table:

LOAD *,

  If(Left(FieldName, 16) = 'in_bu_re_estate_', SubField(FieldName, 'in_bu_re_estate_', 2), 'Other') as NewFieldName;

LOAD * Inline [

FieldName

in_bu_re_estate_agra_uttar_pradesh ,

in_bu_re_estate_mumbai

in_bu_re_estate_delhi

in_bu_re_estate_bilaspur_chattisgarh_india

abc

def

];


Capture.PNG

View solution in original post

4 Replies
sunny_talwar

Try this:

SubField(FieldName, 'in_bu_re_estate_', 2) as NewFieldName

Sample for your attached data:

Table:

LOAD *,

  SubField(FieldName, 'in_bu_re_estate_', 2) as NewFieldName;

LOAD * Inline [

FieldName

in_bu_re_estate_agra_uttar_pradesh ,

in_bu_re_estate_mumbai

in_bu_re_estate_delhi

in_bu_re_estate_bilaspur_chattisgarh_india

];

Capture.PNG

Chanty4u
MVP
MVP

try dis

LEFT(TEXT(SubField(YourField,'/',2)),10)

or

TEXT(MID(YourField,Index(YourField,'/'),10))

brijeshvma
Partner - Creator
Partner - Creator
Author

Hi Sunny ,

Thanks for ur Reply... Its Correct just help me one thing in the same question..

say if name    not start with  in_bu_re_estate_   so display Other.

Means in NewFieldName Column it shows as Others which is not starting with

in_bu_re_estate_ This

sunny_talwar

May be this:

Table:

LOAD *,

  If(Left(FieldName, 16) = 'in_bu_re_estate_', SubField(FieldName, 'in_bu_re_estate_', 2), 'Other') as NewFieldName;

LOAD * Inline [

FieldName

in_bu_re_estate_agra_uttar_pradesh ,

in_bu_re_estate_mumbai

in_bu_re_estate_delhi

in_bu_re_estate_bilaspur_chattisgarh_india

abc

def

];


Capture.PNG