Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
james_hanify
Creator
Creator

Unable to use ApplyMap properly

Hi all,

We are trying to do a connection to pardot using Rest and have the data. We would like to remove duplicates from a many to one relationship and turn it into a 1 to 1.

i.e.

list_email_idemail_id
12341
12342
12353
12364

Would become:

list_email_idemail_id
12341
12353
12364

I am wondering whether it is because it is resident - twice?

[map_emails]:

mapping load distinct [list_email_id],

[email_id]

Resident RestConnectorMasterTable WHERE [list_email_id] <> null();

[map_emails_contents]: // this was to check the mapping was done correctly

load distinct [list_email_id] as [list_email_id_temp],

[email_id] as [email_id_temp]

Resident RestConnectorMasterTable WHERE [list_email_id] <> null();

[UniqueEmailTable]:

LOAD Distinct

[list_email_id] as ListEmailId_TEMP,

ApplyMap('[map_emails]',[list_email_id], null()) as EmailId_TEMP

RESIDENT RestConnectorMasterTable Where [list_email_id] <> null();

Instead all it does is show this

ListemailId_TEMPEmailId_TEMP
784917751-

So presumably it couldn't find it, but clearly there is loads and mapping load picks the first one it finds i believe?

Thank you.

1 Solution

Accepted Solutions
james_hanify
Creator
Creator
Author

Seemingly this fixed it, i can't have square brackets around the table name? I don't even know what the brackets do other than allows spaces I presume?

map_emails:

mapping load distinct [list_email_id],

[email_id]

Resident RestConnectorMasterTable WHERE [list_email_id] <> null() and [email_id] <> null();

[UniqueEmailTable]:

LOAD Distinct

[list_email_id] as list_email_id_TEMP,

ApplyMap('map_emails',[list_email_id], null()) as email_id_TEMP

RESIDENT RestConnectorMasterTable Where [list_email_id] <> null();

View solution in original post

1 Reply
james_hanify
Creator
Creator
Author

Seemingly this fixed it, i can't have square brackets around the table name? I don't even know what the brackets do other than allows spaces I presume?

map_emails:

mapping load distinct [list_email_id],

[email_id]

Resident RestConnectorMasterTable WHERE [list_email_id] <> null() and [email_id] <> null();

[UniqueEmailTable]:

LOAD Distinct

[list_email_id] as list_email_id_TEMP,

ApplyMap('map_emails',[list_email_id], null()) as email_id_TEMP

RESIDENT RestConnectorMasterTable Where [list_email_id] <> null();