Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How do I compare fields from 2 separate load statements?

I am loading data from one file to another and joining it together as the load script below shows. The goal is to validate that my update to a system worked. The my_list table has what names in the system should have been updated to. The system table loads a dump from the system to show what the name currently is. I want to create a field called update_success (bolded below) that contains 'Yes' if what the name should be matches the name in the system, and 'No' if it does not match. However, when I load the script below I get the error "Field not found - <name_should_be>". Is there a better / good way to make this work? Thanks.

my_list:
LOAD text(id_num) as id_num,
     name_should_be
FROM

(ooxml, embedded labels, table is data);

system:
left join (my_list)
LOAD text(id_num) as id_num,
     name as name_in_system,
     if(name_should_be = name_in_system, 'Yes', 'No') as update_success
FROM
C:\Downloads\dump.txt
(txt, codepage is 1252, embedded labels, delimiter is '~');

1 Solution

Accepted Solutions
PrashantSangle

Hi,

Try after left join

Try like

my_list:
LOAD text(id_num) as id_num,
name_should_be
FROM

(ooxml, embedded labels, table is data);

//system:
left join (my_list)
LOAD text(id_num) as id_num,
name as name_in_system
     //if(name_should_be = name_in_system, 'Yes', 'No') as update_success
FROM
C:\Downloads\dump.txt
(txt, codepage is 1252, embedded labels, delimiter is '~');

My_List_System:

load *,

if(name_should_be = name_in_system, 'Yes', 'No') as update_success

Resident my_list;

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 🙂

View solution in original post

3 Replies
PrashantSangle

Hi,

Try after left join

Try like

my_list:
LOAD text(id_num) as id_num,
name_should_be
FROM

(ooxml, embedded labels, table is data);

//system:
left join (my_list)
LOAD text(id_num) as id_num,
name as name_in_system
     //if(name_should_be = name_in_system, 'Yes', 'No') as update_success
FROM
C:\Downloads\dump.txt
(txt, codepage is 1252, embedded labels, delimiter is '~');

My_List_System:

load *,

if(name_should_be = name_in_system, 'Yes', 'No') as update_success

Resident my_list;

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 🙂
PrashantSangle

Hi,

Before combining two table you can not my_list table fields into System table.

First you have to join it then using resident load you can access both field in one table.

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 🙂
Not applicable
Author

Thanks Max. This worked.