Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
vanderson009
Creator III
Creator III

Scripting Help

Hello guys,

I have 2 tables like below.

TableA :

Column1Column2Comment

Comment Column includes some Comment Sentence. Comment Sentence having some words like Column "Word" from TableB.

Those are having Word as frustrating or frustrated or frustration where i have to apply FLAG as CE negative,

Those are having Word as efficient or prompt or satisfied where i have to apply FLAG as CE positive and so on...

But the thing is that their is no linking between TableA and TableB.

TableB:

TagsWords
CE negativefrustrating, frustrated, frustration
CE positiveefficient, prompt, satisfied
Staff poor

friendlier, rude, not pleasant

Please help me for this task....

-- Thanks and Regards,

Villyee Anderson

23 Replies
richard_pearce6
Luminary Alumni
Luminary Alumni

Maybe you could load table B into variables and use the wildmatch() function to set the flags

vanderson009
Creator III
Creator III
Author

Hi Richard,

Thanks for your reply, but how can i store table into variable.

Is it possible to store multiple values in to variable.

-- Regards,

Villyee

richard_pearce6
Luminary Alumni
Luminary Alumni

You could use this script:

TableB:

Load

     Tags

     ,Words

<File Location> (QVD);

For vCurser = 0 to NoOfRows('TableB')

 

     LET vVariableName = Peek('Tags',vCurser,'TableB');

     LET $(vVariableName) = Peek('Tags',Words,'TableB');

Next vCurser


richard_pearce6
Luminary Alumni
Luminary Alumni

Actully WildMatch won't do this, I think you have to split up the words into separate variables and check each one using index() or substringcount() which could be handy to count the number of times you find the word.

How many Tags and words do you have?

Richard

vanderson009
Creator III
Creator III
Author

Hi Richard,

When i reloaded the script, it gives me error like as...

-- Regards,

Villyee

maleksafa
Specialist
Specialist

i think you need to transform the Table B to one word per line so for example

TagsWords
CE negativefrustrating
CE negativefrustrated
CE negative

frustration

and then use the VLookup function on tableA field Comment to match with Field Words from TableB

vanderson009
Creator III
Creator III
Author

around 21 Tags and each tag having minimum 10 and maximum 25 to 30 Words.

vanderson009
Creator III
Creator III
Author

Hi Malek,

How could i apply vLookup function in qlikview.

can we apply vLookup even both table doesnt having link between them.

- Regards,

Villyee

richard_pearce6
Luminary Alumni
Luminary Alumni

That's because you're trying to set a variable name with a space in it.. You could use replace to remove them although I would leave that as it was for wildmatch and that won't work as far as I can see.

Richard