Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
capriconuser
Creator
Creator

Match column values

In one table there is column product

Product 
1233-901
3945-847
3956-234
3462
2940
2357

and in table 2 i have product column and data is

product
1233
3495
3456
3462
2940
2357

i want to match values of these column and get only first 4 characters .. so i tried this

first i load this in tab1

    LOAD 
     left(Product,5) as Product_code,    
FROM
F2.xlsx
(ooxml, embedded labels, table is PM1);

and in second tab i load this

Load Product FROM
F3q.xlsx
(ooxml, embedded labels, table is PM2);

but i did not get data ... i get data like this

   Product_code   Product 
    1233             - 
    3945             -
    3956             -
    3462          3462
    2940          2940
    2357          2357
      -            1233
      -            3495
      -            3456

where as i am trying to get data like this

Product_code   Product 
1233             1233
3945             3495
3956             3496
3462             3462
2940            2940
2357            2357
2 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Like this:

LOAD Trim(SubField(Product, '-', 1)) as Product_code,    
FROM F2.xlsx
(ooxml, embedded labels, table is PM1);

Load Trim(Product) as Product
FROM F3q.xlsx
(ooxml, embedded labels, table is PM2);

Or use this to associate the data:

Load Trim(Product) as Product_code
FROM F3q.xlsx
(ooxml, embedded labels, table is PM2);

I am assuming that these snippets are part of a larger set of loads. 

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
PrashantSangle

use trim(left(product),4)

Regards,
Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂