Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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;
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;
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;
I too was trying the same - but the string gets jumbled up because of the Sort Order in concat().
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;
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
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
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
By 'variable level' if you mean UI solution, I don't see an easy dynamic solution for this.
Hi Salman,
It might be work,
So, please check the attachment.