Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Mathc fieldvalue from two other tables

Hi all!

Could you help me with this issue:

I have two tables:

Color

Green

Red

Orange

Yellow

Other

Item

Sweater for girls Green

dress  Red

Bag Orange apple

Yellow coat

Blue jeans

The result I'm looking for after comparing these tables would then look like this:

Field1

Field2

Sweater Green for girls

Green

dress  Red

Red

Yellow coat

Yellow

Bag Orange apple

Orange

Blue jeans

Other

Which is the best way to do it?

1 Solution

Accepted Solutions
danieloberbilli
Valued Contributor II

Re: Mathc fieldvalue from two other tables

Capture23.PNG.pngPlease find QVW with solution attached.

4 Replies
vgutkovsky
Honored Contributor II

Re: Mathc fieldvalue from two other tables

Ksenia, if this is, in fact, the full extent of the problem, just code it manually using substringcount. For example:

if(substringcount(Item,'Red')>0,

     'Red',

     if(substringcount(Item,'Green')>0,

          'Green',

          ....

) as Field2

If your real data is more extensive (as I'm guessing is the case), take a look at Rob Wunderlich's QlikView Cookbook. Specifically, the mappingWithWildcards.qvw example.

Regards,

Vlad

danieloberbilli
Valued Contributor II

Re: Mathc fieldvalue from two other tables

Capture23.PNG.pngPlease find QVW with solution attached.

Not applicable

Re: Mathc fieldvalue from two other tables

Hi Vlad!

Thanks for your answer. You are right, it is a only simple example, i have more extensive data and it may change.

Thanks for advice, i'll take a look this book surely!

Not applicable

Re: Mathc fieldvalue from two other tables

Hi Daniel! Thank you! I like it!

Community Browser