Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

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
MVP & Luminary
MVP & Luminary

Re: Incorrect join

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


talk is cheap, supply exceeds demand
3 Replies
Not applicable

Re: Incorrect join

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

MVP & Luminary
MVP & Luminary

Re: Incorrect join

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


talk is cheap, supply exceeds demand
Not applicable

Re: Incorrect join

Where would I be without you Gysbert?!

thanks AGAIN