Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Ayoub
Contributor III
Contributor III

Delete Duplicated words

Hello community .. 

in an application i'm working on we need to delete duplicated words in sentences like :  Qlik Qlik View we should get Qlik View 

i worked with the code bellow but it didn't give  me the result i'm looking for .  i should look for all the repeated words in the same sentences and delete them.  

dup.PNG

1 Solution

Accepted Solutions
marcus_sommer

I think I wouldn't use a sub-routine with/within outside-loops else normal loads with inside-loops and an aggregation - something in this way:

t1:
load *, -(StringPart = previous(StringPart)) as Flag, rowno() as RowNo;
load String, subfield(String, ' ') as StringPart from Source;

t2:
load concat(StringPart, ' ', RowNo) resident t1 where Flag = 0;

- Marcus

View solution in original post

4 Replies
marcus_sommer

I think I wouldn't use a sub-routine with/within outside-loops else normal loads with inside-loops and an aggregation - something in this way:

t1:
load *, -(StringPart = previous(StringPart)) as Flag, rowno() as RowNo;
load String, subfield(String, ' ') as StringPart from Source;

t2:
load concat(StringPart, ' ', RowNo) resident t1 where Flag = 0;

- Marcus

Ayoub
Contributor III
Contributor III
Author

i liked  ur answer @marcus_sommer and as i'm new at qlikview ..  How could i get  the result i'm looking for  for exemple : ayub atr 

marcus_sommer

Did you try my suggestion? Just apply it step by step and look what happens to understand the logic. After it you could extend it to your real requirement which probably contained any ID and maybe need the one or another adjustment.

- Marcus

Ayoub
Contributor III
Contributor III
Author

Thank u So much for the Help 😄