Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Mixmatch - Use function against a table


Hi,

I have a list of values that I need to run the mixmatch function against. At the moment this isn't a problem as the list is static but this will change in the future. What I would like to do is store all possible values in an excel file and give the end user access to this file so that they can amend the list when required.

In this case, is it possible to run the mixmatch function against a table and if so, how is this done?

EXAMPLE

Current Function:

IF(MIXMATCH(Month, 'June', 'July', 'August'), 'Y', 'N') AS Summer

Desired Function:

IF(MIXMATCH(Month, [INSERT TABLE LOOKUP HERE]), 'Y', 'N') AS Summer

Thanks!

1 Solution

Accepted Solutions
Gysbert_Wassenaar

With the help of a variable it should be possible. Something like:

TmpLookup:

LOAD concat(chr(39) & Month & chr(39), ',') as LookUpList

FROM ...excel_file_here...;

LET vLookupList = peek('LookUpList');

DROP table TmpLookup;

Data:

LOAD ...some_fields...,

     IF(MixMatch(Month, $(vLookUpList)), 'Y','N') as Summer

FROM ...source_here...;


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

With the help of a variable it should be possible. Something like:

TmpLookup:

LOAD concat(chr(39) & Month & chr(39), ',') as LookUpList

FROM ...excel_file_here...;

LET vLookupList = peek('LookUpList');

DROP table TmpLookup;

Data:

LOAD ...some_fields...,

     IF(MixMatch(Month, $(vLookUpList)), 'Y','N') as Summer

FROM ...source_here...;


talk is cheap, supply exceeds demand
Not applicable
Author


Excellent, thanks Gysbert, the solution worked perfectly!