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

Data on Qlik not showing the relations

Hello

I have a database that holds a lot of tables with defined relationship..

I have connected to the database via OLEDB.  #connection successful

roharohabill.markhamtheresaa

on the frontend, I have created the table to visual the data.

My challenge is I can link the data from different tables

here are sample tables as they are on the

Company Table

vOMLIddAward DatedExpiration Date
iOperator IdvContact TypeIdStatus
Company A04/04/198003/04/20001P1
Company B02/03/199001/03/20103T1
Company C03/04/199002/04/20102P2
Company ZDD/MM/YYYYDD/MM/YYYY3P1

Operator Table

iOperator IdDescription
1Sony
2Samsung
3Nokia

Contract Table   

Contract TypeDescription
PPermanent
TTemporary

Status Table

Contract TypeDescription
1Producing
2Non-Producing

My Proposed Table on Qlik front end

vOMLIddAward DatedExpiration Date
iOperator IdvContact TypeIdStatus
Company A04/04/198003/04/2000SonyPermanentProducing
Company B02/03/199001/03/2010NokiaTemporaryProducing
Company C03/04/199002/04/2010SamsungPermanentNon-Producing

See attached for snapshots

13 Replies
akpofureenughwu
Creator III
Creator III
Author

Thank Staffan.. the Apply map function will meet the need of my script. I'm trying to apply it but I have a problem. Can you help me debug my script?

Here is it :

MapvTitleNametoiTitleId:

    MappingvTitleNametoiTitleId from NPDCBI.crd.Title;

[Title]:

LOAD iTitleId,

    vTitleName;

SQL SELECT iTitleId,

    vTitleName

FROM xyz.crd.Title;

LOAD *;

     ApplyMap('MapvTitleNametoiTitleId',iTitleId,null())as Title;

SQL SELECT iCommunityId,

    iLeadershipPosition,

    iCommunityLeaderId,

    vSurname,

    vMiddleName,

    vFirstName,

    vPhoneNumber,

    iTitleId,

    vEmail,

    vPassport

FROM xyz.crd.CommunityLeaders;

Attached is d the model view

akpofureenughwu
Creator III
Creator III
Author

I want to do a vlookup (applymap) from  title table to community leader table

akpofureenughwu
Creator III
Creator III
Author

I have mamaged to fix the bug...

Below is the correct script:

TitleMap:

Mapping Load Distinct

    iTitleId,

    vTitleName;

SQL SELECT iTitleId,

    vTitleName

FROM xyz.crd.Title;

[Community]:

NoConcatenate LOAD

    iCommunityId,

    iLeadershipPosition,

    iCommunityLeaderId,

    vSurname,

    vMiddleName,

    vFirstName,

    vPhoneNumber,

    iTitleId,

    vEmail,

    ApplyMap('TitleMap',iTitleId, Null()) as [LeaderTitle];

   

SQL SELECT iCommunityId,

    iLeadershipPosition,

    iCommunityLeaderId,

    vSurname,

    vMiddleName,

    vFirstName,

    vPhoneNumber,

    iTitleId,

    vEmail,

    vPassport

FROM xyz.crd.CommunityLeaders;

This link will help for further study: Mapping as an Alternative to Joining

https://community.qlik.com/blogs/qlikviewdesignblog/2012/09/18/one-favorite-function-applymap 

Thank you Staffan

akpofureenughwu
Creator III
Creator III
Author

Thank you sir for your reponse