Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikView forum consolidation is complete. Labels are now required. LEARN ABOUT LABELS
cancel
Showing results for 
Search instead for 
Did you mean: 
smilingjohn
Creator III
Creator III

load atuo compare

Hi All ,

I have two tables in my Load script . Which is  making the link using 'Customer ID' Now Table A has lots of data , 

But i want to load only that data whiere the CutomerID of Table B matches with the Customer ID of Table A . 

How can I achive this ? I know i can use where function and need to specify manaul entries of the Customer ID's which is a headache. 

Please suggest how can I make this automated. 

Table A:

Load 

Department,

Section,

Sales,

ID,

Region,

Customer_ID

From......

 

Table B:

Load

Business,

Products,

Parcels,

Category,

Customer_ID,

From....

 

Thanks in advance

1 Solution

Accepted Solutions
zhadrakas
Specialist II
Specialist II

in that case just load table B first and then Load Table A with where exists()

TableB:
LOAD CustomerID, 
     ITComp, 
     Are, 
     Sales, 
     Gravity
FROM [C:\APP\TestData.xlsx] (ooxml, embedded labels, table is Sheet4)
;

TableA:
LOAD CustomerID, 
     Deoartment, 
     Product, 
     Region, 
     Incometx, 
     FloorID
FROM [C:\APP\TestData.xlsx] (ooxml, embedded labels, table is Sheet1)
where exists(CustomerID);

View solution in original post

5 Replies
zhadrakas
Specialist II
Specialist II

use exists() function in where clause. this also keeps the optmized load.

Exists - Skriptfunktion ‒ QlikView

A:
Load
Department,
Customer_ID 

B:
Load 
A,
B,
Customer_ID
where exists(Customer_ID)

 

smilingjohn
Creator III
Creator III

I am confused ..

I have so many fields in Table A how can i write ur sript example ?

zhadrakas
Specialist II
Specialist II

just add this line in the second load Statement.

where exists(Customer_ID)

 if you want to check more fields go like

where exists(Customer_ID)
  and exists(Department)
smilingjohn
Creator III
Creator III

Thanks for the reply 

PLease find the attachment of the QVW.

I want to keep my table and the fields as it is . 

In tableA there are 26 Customer ID  and in Table 2 there are only 9 customer ID .

I want to load Table A data related to only 9 Customer ID's of Table B . 

Thanks 

zhadrakas
Specialist II
Specialist II

in that case just load table B first and then Load Table A with where exists()

TableB:
LOAD CustomerID, 
     ITComp, 
     Are, 
     Sales, 
     Gravity
FROM [C:\APP\TestData.xlsx] (ooxml, embedded labels, table is Sheet4)
;

TableA:
LOAD CustomerID, 
     Deoartment, 
     Product, 
     Region, 
     Incometx, 
     FloorID
FROM [C:\APP\TestData.xlsx] (ooxml, embedded labels, table is Sheet1)
where exists(CustomerID);

View solution in original post