Skip to main content
Announcements
Global Transformation Awards submissions are open! SUBMIT YOUR STORY
cancel
Showing results for 
Search instead for 
Did you mean: 
Meghann_MacDonald

Load Data Dependent on Values from Previous Table

Hi all,

I want to only load values from Table B that are labeled 'Lead' in Table A.

Ex:

[Table A]:

LOAD

[Registration Email],

[Status],

[user_id]

From ABC;

 

[Table B]:

email as [Registration Email],

Alternate data (leadinfo, etc)

From XYZ (where the email in Table A is listed as 'Lead' for [Status];

 

Is this possible?

Meghann

1 Solution

Accepted Solutions
TiagoCardoso
Creator II
Creator II

[Table A]:

LOAD

[Registration Email],

[Status],

[user_id]

From ABC;

NOCONCATENATE temp: LOAD [Registration Email] RESIDENT [Table A] WHERE Status = 'Lead';

LEFT KEEP (temp)
[Table B]:

email as [Registration Email],

Alternate data (leadinfo, etc)

From XYZ (where the email in Table A is listed as 'Lead' for [Status];

DROP TABLE temp;

View solution in original post

12 Replies
Anil_Babu_Samineni

Can you point out with sample data how you should need as outcome? We can see the possibility?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
TiagoCardoso
Creator II
Creator II

HI, sorry for my english.

Try this, maybe can help you.

 

[Table A]:

LOAD

[Registration Email],

[Status],

[user_id]

From ABC;

 

LEFT KEEP([Table A])

[Table B]:

email as [Registration Email],

Alternate data (leadinfo, etc)

From XYZ (where the email in Table A is listed as 'Lead' for [Status];

Meghann_MacDonald
Author

Hi Anil, sure.

Table A currently yields something like this:

Meghann_MacDonald_0-1605643745719.png

So, I want Table B to load any matching emails that are considered 'leads', aka I want it to load accompanying data for the emails in row 2 and 4. That table would be from a different source. I don't think this matters but I will be pulling this kind of thing: 

Meghann_MacDonald_1-1605643889935.png

 

Meghann_MacDonald
Author

Hi @TiagoCardoso , I have tried Left Keep but it includes/keeps all the emails that match, not only the ones that are considered 'Lead'. The place I typed "(where the email in Table A is listed as 'Lead' for [Status]" is what I need converted into code! (aka XYZ source has all of the emails and their data but I don't want all of it)

Anil_Babu_Samineni

how is that Table B looks like, Based on that I can print something for you, If that we have workaround.

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Meghann_MacDonald
Author

Hi @Anil_Babu_Samineni , I do not know what you mean. 

TiagoCardoso
Creator II
Creator II

[Table A]:

LOAD

[Registration Email],

[Status],

[user_id]

From ABC;

NOCONCATENATE temp: LOAD [Registration Email] RESIDENT [Table A] WHERE Status = 'Lead';

LEFT KEEP (temp)
[Table B]:

email as [Registration Email],

Alternate data (leadinfo, etc)

From XYZ (where the email in Table A is listed as 'Lead' for [Status];

DROP TABLE temp;

TiagoCardoso
Creator II
Creator II

Maybe too

 

[Table A]:

LOAD

[Registration Email],

[Status],

[user_id]

From ABC;


MapTemp:MAPPING LOAD [Registration Email],1 RESIDENT [Table A] WHERE Status = 'Lead';


[Table B TEMP]:

email as [Registration Email],

APPLYMAP('MapTemp',email,0) AS Field,

Alternate data (leadinfo, etc)

From XYZ (where the email in Table A is listed as 'Lead' for [Status];

NOCONCATENATE [Table B]: LOAD * RESIDENT [Table B TEMP] WHERE Field = 1;

DROP FIELD Field  FROM [Table B];

DROP TABLE [Table B TEMP];

Anil_Babu_Samineni

Sorry, I mean your destination table how it is. Anyway, Can you reload like this way and see If that meets what you need. If not, Please explain based on given sample data to get work

[Table A]:
LOAD email as [Registration Email], leadsource, registrationdate Inline [
email, leadsource, registrationdate
abc@gmail.com, web, 1/1/2011
qlik@qlik.com, organic, 1/1/2020
];

[Table B]:
LOAD * Inline [
Registration Email, Status, user_id
abc@gmail.com, Lead, 1
xyz@gmail.com, Contact, 2
qlik@qlik.com, Lead, 3
] Where Exists([Registration Email]) and Status='Lead';

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful