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

Incorrect join

I'm a bit of a beginner at this and am trying to do a join between two tables

My script below seems to assign each contact every value of the Contact Record Type. Obviously each contact should only have one record type though.

Any ideas what i'm doing wrong?

QUALIFY *;

UNQUALIFY Activity.ConatctRecordTypeId;

UNQUALIFY Activity.AccountId;

UNQUALIFY Activity.ContactId;

UNQUALIFY Activity.Department_Role__c;

UNQUALIFY Activity.Business__c;

Contacts:

LOAD Id as Activity.ContactId,

    AccountId AS Activity.AccountId,

    Name,

    RecordTypeId AS Activity.ConatctRecordTypeId,

    CreatedDate,

    Department_Role__c AS Activity.Department_Role__c,

    Business__c AS Activity.Business__c,

    Asset_Class__c,

    Inactive_Contact__c,

    Region__c;

SQL SELECT *

FROM Contact

WHERE RecordTypeId NOT IN ('012w000000063XQ','012w000000063qu');

UNQUALIFY *;

//Contact Record Types

QUALIFY *;

UNQUALIFY Activity.ContactRecordTypeId;

ContactRecordType:

LEFT JOIN (Contacts)

ContactRecordType:

LOAD Id AS Activity.ConatctRecordTypeId,

    Name;

SQL SELECT *

FROM RecordType

WHERE SobjectType IN ('Contact');

UNQUALIFY *;

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Could be a typo: LOAD Id AS Activity.ConatctRecordTypeId,


talk is cheap, supply exceeds demand

View solution in original post

3 Replies
Not applicable
Author

Check how you unqualify names - make sure you are using original names from data source. Check field names in Table viewr. And make sure Contact Record Type has exactly same name in both tables. Most probably, you have fields Activity.Activity.ConatctRecordTypeId and ContactRecordType.Activity.ConatctRecordTypeId

Gysbert_Wassenaar

Could be a typo: LOAD Id AS Activity.ConatctRecordTypeId,


talk is cheap, supply exceeds demand
Not applicable
Author

Where would I be without you Gysbert?!

thanks AGAIN