Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Ayoub
New 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 

1 Solution

Accepted Solutions
Ayoub
New Contributor III

Re: Pick out abbreviation

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

Re: Pick out abbreviation

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
New Contributor III

Re: Pick out abbreviation

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

Re: Pick out abbreviation

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

Highlighted
Ayoub
New Contributor III

Re: Pick out abbreviation

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

Support
Support

Re: Pick out abbreviation

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 don't forget to use the "Accept as Solution" button on any posts that helped you resolve your problem or question.
Ayoub
New Contributor III

Re: Pick out abbreviation

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