Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
justcotto
Contributor III
Contributor III

Update data in one spreadsheet based off data from another spreadsheet file

I have an excel file (file1.xlsx) that contains four columns (Term, Definition, Page and Calculation) and another file (file2.xlsx) with three columns (Term, Definition and Calculation).  I want the second file to update the first if it encounters a term that is in both.  I want it to update the Term, Definition and Calculation of file1.xlsx.

Thank you

6 Replies
rubenmarin

If all terms in file2 exists in file1 you can load file2 first and use exists to load only non-existant terms, ie:

LOAD * From [...file2...](...);
Concatenate LOAD * from [...file1...](...) where not exists(Term);
dplr-rn
Partner - Master III
Partner - Master III

Dont understand your problem exactly.

In excel 1 you have

Term, Definition, Page and Calculation

Excel 2 you have

Term, Definition and Calculation

On which column are you matching values between the excels? And which column or columns in excel 1 do you want o update

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

A modification to Ruben's answer.  You will have to load file1 a second time to get Page values, which I understand are only in File1. 

Data:
LOAD * From [...file2...](...);

Concatenate (Data)
LOAD Term, Definition, Calculation
from [...file1...](...) where not exists(Term);

Join (Data) 
LOAD Term, Page
from [...file1...](...)

-Rob

justcotto
Contributor III
Contributor III
Author

For Excel 1 I would like for the definition and calculation to be updated if a Term is encountered that is in both Excel 1 and 2.  Excel 2 has all the correct definitions or standard definitions. Excel 1 may have erroneous data.  Excel 2 is used to correct any data that may not be correct in Excel 1.  I don't want to bring in all the data from Excel 2, only the corrections.  

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

TempKey:
LOAD Term as TermFile1
from [...file1...](...);

Data:
LOAD * From [...file2...](...)
where exists(TermFile1, Term);

Concatenate (Data)
LOAD Term, Definition, Calculation
from [...file1...](...) where not exists(Term);

Join (Data) 
LOAD Term, Page
from [...file1...](...)

DROP TABLE TempKey;

-Rob