Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Gowtham174
Creator
Creator

Need to remove (****) from data set

Hi All,

Can you please help me to remove the bracket values present in the data set where inside the bracket() remove all the information along with bracket and replace with . dot.

Example:

Data field

Field1.

My name is (0000) Gowtham

Output should be

Field1.

My name is . Gowtham

Thanks,

Gowtham

1 Solution

Accepted Solutions
nsetty
Partner - Creator II
Partner - Creator II

Datafield:

Load *,

TextBetween(Field1,'(',')') as Text1,

Replace(Field1, '('&TextBetween(Field1,'(',')')&')', '.') as RequiredText;

Load * Inline

[

Field1

My name is (0000) Gowtham

];

View solution in original post

11 Replies
Ivan_Bozov
Luminary
Luminary

REPLACE(Field1, '(0000)',  '.')

vizmind.eu
Anonymous
Not applicable

Hi

Try the below calculation it will work for specific scenario

Left(ctext,Index(ctext,'(')-1)&'.'& Right(ctext,(len(ctext)-Index (ctext,')')-1))

Thanks

nsetty
Partner - Creator II
Partner - Creator II

Datafield:

Load *,

TextBetween(Field1,'(',')') as Text1,

Replace(Field1, '('&TextBetween(Field1,'(',')')&')', '.') as RequiredText;

Load * Inline

[

Field1

My name is (0000) Gowtham

];

sujeetsingh
Master III
Master III

Man I doubt that people here have recommended a lots of solution and there is no single reply from you.

Gowtham174
Creator
Creator
Author

This will remove only one (000).

In my case few row as like

Field1.

row1 : My name is (0000) Gowtham

row2 : My name is (0000) Gowtham ,My name is (0001) Gowtham,My name is (0002) Gowtham,My name is (0002)


row2 is not removing multiple brackets

inside the brackets random numbers are there

Gowtham174
Creator
Creator
Author

This will remove only one (000).

In my case few row as like

Field1.

row1 : My name is (0000) Gowtham

row2 : My name is (0000) Gowtham ,My name is (0001) Gowtham,My name is (0002) Gowtham,My name is (0002)


row2 is not removing multiple brackets

inside the brackets random numbers are there

nsetty
Partner - Creator II
Partner - Creator II

Datafield:

Load *,

TextBetween(Field1,'(',')') as Text1,

Replace(Field1, '('&TextBetween(Field1,'(',')')&')', '.') as Text2,

Replace(Replace(Replace(Field1, '('&TextBetween(Field1,'(',')',1)&')', '.'), '('&TextBetween(Field1,'(',')',2)&')', '.'), '('&TextBetween(Field1,'(',')',3)&')', '.') as RequiredText,

;

Load * Inline

[

Field1

My name is (0000) Gowtham

'My name is (0000) Gowtham ,My name is (0001) Gowtham,My name is (0002) Gowtham,My name is (0002)'

];

try this.

Quy_Nguyen
Specialist
Specialist

Between ()  always digit?

If so, try:

Load Replace(PurgeChar(Field1,'0123456789'),'()','.') As Field1;

Load * Inline

[

Field1

My name is (0000) Gowtham

'My name is (0000) Gowtham ,My name is (0001) Gowtham,My name is (0002) Gowtham,My name is (0002)'

];

nsetty
Partner - Creator II
Partner - Creator II

Load Replace(Field1,'()','.') As Field1; 

Load PurgeChar(Field1,'([0][1][2][3][4][5][6][7][8][9])') as Field1; 

Load * Inline  

[  

Field1  

My name is (0000) Gowtham  

'My name is (0000) Gowtham ,My name is (0001) Gowtham,My name is (0002) Gowtham,My name is (0002)'  

];  

Does PurgeChar function considers/recognizes regular expression.?

Above seems to work.  It replaces all the integers between ()

Thanks

Nagesh