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

removed the single alphabet from the string

Hi Guys,

How are you?

i want to get rid of single alphabet from the string

exp

 

NH JU Y OK
TH JU S OK

i have two strings as above so i am expecting the result as below can you please help me out.

NH JU  OK
TH JU  OK

if you all  have observed that i have removed  the single alphabet from given strings.

1 Solution

Accepted Solutions
swuehl
MVP
MVP

There is an optional argument for sort weight available for the Concat() function ...

temp:

load

RecNo() as row,

SubField(A,' ', iterno()) as Field,

iterno() as index

inline [

A

'NH JU Y OK'

'TH JU S OK'

]

WHILE iterno() <= Substringcount(A,' ')+1;

load Concat( Field,' ',index) as NewField,

row

Resident temp

where len(Field)>1

Group by row;

drop table temp;

View solution in original post

14 Replies
robert_mika
Master III
Master III

something like this:

(the only downturn is that the  order will be slightly changed)

temp:

load

RecNo() as row,

SubField(A,' ') as Field;

load * inline [

A

'NH JU Y OK'

'TH JU S OK'

];

load Concat( Field,' ') as NewField,

row

Resident temp

where len(Field)>1

Group by row;

drop table temp;

Capture.PNG

tresesco
MVP
MVP

One way could be like:

Input:

Load *, RowNo() as ID Inline [

String

NH JU Y OK

TH JU S OK

];

Join

Load StrTemp, ID

where Len(StrTemp)=1;

Load SubField(String,' ') as StrTemp, ID Resident Input;

Final:

Load Replace(String, ' '&StrTemp&' ', ' ') as finalString Resident Input;

Drop table Input;

tresesco
MVP
MVP

I too was trying the same - but the string gets jumbled up because of the Sort Order in concat().

swuehl
MVP
MVP

There is an optional argument for sort weight available for the Concat() function ...

temp:

load

RecNo() as row,

SubField(A,' ', iterno()) as Field,

iterno() as index

inline [

A

'NH JU Y OK'

'TH JU S OK'

]

WHILE iterno() <= Substringcount(A,' ')+1;

load Concat( Field,' ',index) as NewField,

row

Resident temp

where len(Field)>1

Group by row;

drop table temp;

alis2063
Creator III
Creator III
Author

Hi Stefan,

Thanks for your great effort.

Can you please let me know that is there any possibility can we handle the above scenario through the variable as i did in Sap Business object Tool but its different approach so i thinks that  it may be possible on variable level.

Regards,

Ali

alis2063
Creator III
Creator III
Author

Hi Tresco,

Thanks for your great effort.

Can you please let me know that is there any possibility can we handle the above scenario through the variable as i did in Sap Business object Tool but its different approach so i thinks that  it may be possible on variable level.

Regards,

Ali

alis2063
Creator III
Creator III
Author

Hi Robert,

Hope you well.

Thanks for your great effort.

Can you please let me know that is there any possibility can we handle the above scenario through the variable as i did in Sap Business object Tool but its different approach so i thinks that  it may be possible on variable level.

Regards,

Ali

tresesco
MVP
MVP

By 'variable level' if you mean UI solution, I don't see an easy dynamic solution for this.

susovan
Partner - Specialist
Partner - Specialist

Hi Salman,

It might be work,

So, please check the attachment.

45.JPG

Warm Regards,
Susovan