Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
mwscott1
Creator
Creator

Return columns that match with wildcard

I have two table Table 1 and Table 2 that are LEFT joined by TIN. However, multiple users share the same TIN and NAME. The only difference in the two rows would be the ELEC_ADDR_VAL. I would like to further reduce this using columns NAME and ELEC_ADDR_VAL. to only return rows with a match.

SQL SELECT

    "NAME",

     TIN

FROM TABLE 1;

LEFT JOIN

SQL SELECT

    "CBO_VAL" as TIN,

    "ELEC_ADDR_VAL"

FROM TABLE 2;

TINNAMEELEC_ADDR_VAL
999123456Smith, JohnJSmith@Email.com
999123456Smith, JohnSQue@Email.com

The last name is always present in both columns.

3 Replies
Miguel_Angel_Baeyens

From memory, something like this should work See attached app:

SQL SELECT

    "NAME",

     TIN

FROM TABLE 1;

LEFT JOIN

LOAD *

WHERE WildMatch(SubField(ELEC_ADDR_VAL, '@', 1), '*' & SubField(CBO_VAL, ',', 1) & '*') > 0;

SQL SELECT

    "CBO_VAL" as TIN,

    "ELEC_ADDR_VAL"

FROM TABLE 2;

EDIT: The WHERE clause modified to "> 0"

mwscott1
Creator
Creator
Author

This does not seem to we working in my script. I am loading two separate tables that are joined by the TIN column. Where do I put the WHERE statement you gave me. When I try it like you have it above I get an error "Field not found - <NAME>".