Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
paulwalker
Creator III
Creator III

Need Help

Hi All,

I have 2 tables almost 6 fields are same, remaining fields are different..

Like..

Table1:

Load   

       SalesID
       ProdID,
       CountryCode,
       Sales
       Date
       ProdSesc
       SalesAmt

From Sales;

Table2:

Load  ProdID,

         CountryCode,

         Sales,

         Date,

         ProdDesc,

         OrderAmt,

         OredrName

From Orders;

        

i want to create link table, here should i create all common fields concatenate into one %Key field..

(Like  ProdID & CountryCode & Sales & Date & ProdDesc  as %Key)

or

any other method???

5 Replies
robert_mika
Master III
Master III

You can use As statement

Sales as T2Sales

or Qualify

Look here

Do you Qualify?- How to use QUALIFY statement

Feeling Qlikngry?

How To /Missing Manual(18 articles)

alexandros17
Partner - Champion III
Partner - Champion III

Take a look to autonumberhash256() instruction and to the following document:

Gysbert_Wassenaar

Yes, that's the idea:

Table1:

LOAD

    autonumber(ProdID & '|' & CountryCode &'|' & Sales &'|' & Date &'|' & ProdDesc)  as %Key,

      ...other fields...

FROM ...Table1Source...;

Table2:

LOAD

    autonumber(ProdID & '|' & CountryCode &'|' & Sales &'|' & Date &'|' & ProdDesc)  as %Key,

      ...other fields...

FROM ...Table2Source...;


LinkTable:

LOAD distinct

    autonumber(ProdID & '|' & CountryCode &'|' & Sales &'|' & Date &'|' & ProdDesc)  as %Key,

     ProdId,

     CountryCode,

     Sales,

     Date,

     ProdDesc

FROM ...Table1Source...;


Concatenate(LinkTable)

LOAD distinct

    autonumber(ProdID & '|' & CountryCode &'|' & Sales &'|' & Date &'|' & ProdDesc)  as %Key

     ProdId,

     CountryCode,

     Sales,

     Date,

     ProdDesc

FROM ...Table2Source...;


Note that the common fields now only exist in the LinkTable. Table1 and Table2 only contain %Key and the fields that are unique to the tables.


talk is cheap, supply exceeds demand
JoaquinLazaro
Partner - Specialist II
Partner - Specialist II

Hi Paul:

You can join both tables in only one

Table1:

Load  

       SalesID
       ProdID,
       CountryCode,
       Sales
       Date
       ProdSesc
       SalesAmt

From Sales;

Left Join

Load  ProdID,

         CountryCode,

         Sales,

         Date,

         ProdDesc,

         OrderAmt,

         OredrName

Hope this helps you

Joaquín

qlikmsg4u
Specialist
Specialist

Hi Paul,

Find the attached app