Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Ayoub
Contributor III
Contributor III

Pick out abbreviation

Hello community, 

i wrote a function which can pick out abbreviation word from develloped one. 

but in some cases it doesn't work .  

for exemple the script tell  me 'ok'  that  the Word  ' a b c d ' is an abbreviation 

but the world  's o s NDD'  in fact  is an abbreviation , but the program tell me it's not. 

the code bellow

Sub FilterAbbr(String)


let nbreMots= SubStringCount(String,' ')+1;
For i=1 to $(nbreMots)
let mot$(i)=SubField(String,' ',$(i));
        IF WildMatch('$(mot$(i))','1','2','3','4','5','6','7','8','9','A','Z','E','R','T','Y','U','I','O','P','Q','S','D','F','G','H','J','K','L','M','W','X','C','V','B','N')                then
                   LET vText = vText &' '& '$(mot$(i))';
                   Let vMsg = 'ok';

         ELSE
                   LET vText = vText &' '& '$(mot$(i))';
                   Let vMsg = 'ko';
        ENDIF
NEXT
End Sub;

thank you for yourHelp 

Labels (4)
1 Solution

Accepted Solutions
Ayoub
Contributor III
Contributor III
Author

Here is The Solution 😄

Sub FilterAbbr(String)
Let vText='' ;
Let vMsg ='';
let nbreMots= SubStringCount(String,' ')+1;

For i=1 to $(nbreMots)

let mot$(i)=SubField(String,' ',$(i));

IF WildMatch('$(mot$(i))','1','2','3','4','5','6','7','8','9','A','Z','E','R','T','Y','U','I','O','P','Q','S','D','F','G','H','J','K','L','M','W','X','C','V','B','N') then
LET vText = vText &' '& '$(mot$(i))';
Let vMsg = 'abbr';
EXIT For;
ELSE
LET vText = vText &' '& '$(mot$(i))';
Let vMsg = 'dev';
ENDIF
NEXT

End Sub;

View solution in original post

6 Replies
sunny_talwar

I guess NDD is something you are not checking in your WildMatch function

WildMatch('$(mot$(i))','1','2','3','4','5','6','7','8','9','A','Z','E','R','T','Y','U','I','O','P','Q','S','D','F','G','H','J','K','L','M','W','X','C','V','B','N', 'NDD')

Ayoub
Contributor III
Contributor III
Author

yes i agree but it's just an exemple  i have more than 400 000 lines  , maybe i have 20 000 of this exemple ! 

sunny_talwar

But how do you differentiate between an abbr. and everything else?

Ayoub
Contributor III
Contributor III
Author

this is was the main quest .  but i found it  i'll share the src code 😄 thanks to you 

Brett_Bleess
Former Employee
Former Employee

Ayoub, do not forget to post your solution, once you do, be sure to use the Accept as Solution button to mark it as the solution as well...

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.
Ayoub
Contributor III
Contributor III
Author

Here is The Solution 😄

Sub FilterAbbr(String)
Let vText='' ;
Let vMsg ='';
let nbreMots= SubStringCount(String,' ')+1;

For i=1 to $(nbreMots)

let mot$(i)=SubField(String,' ',$(i));

IF WildMatch('$(mot$(i))','1','2','3','4','5','6','7','8','9','A','Z','E','R','T','Y','U','I','O','P','Q','S','D','F','G','H','J','K','L','M','W','X','C','V','B','N') then
LET vText = vText &' '& '$(mot$(i))';
Let vMsg = 'abbr';
EXIT For;
ELSE
LET vText = vText &' '& '$(mot$(i))';
Let vMsg = 'dev';
ENDIF
NEXT

End Sub;