Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to make composite key in script

hi,

i have three tables,

Table A:

LOAD ULD_CTGRY_CD as ULD_CTGRY_CD_I,

     ULD_CTGRY_DESC as ULD_CTRY_DESC_I

FROM

[xyz]

(qvd);

table B:

TT_IIGMMAIN_Main:

LOAD 

IGM_NO as JOB_NO,

IGM_YR as JOB_YR,

Date(Round(ATA_DTTM),'DD/MM/YYYY') as Date

   

FROM

[MNO.qvd]

(qvd);

table C:

TT_IEMSGCHAII01_JOBULD_RAW:

LOAD

    JOB_NO,

     JOB_YR,

  

     AWB_NO as ULD_AWB_NO,

     //mid(ULD_NO,1,3) as I_ULD_NO,

    if(mid(ULD_NO,1,3)='BUL',mid(ULD_NO,1,4),mid(ULD_NO,1,3)) as I_ULD_NO,

    

    GRSS_WGHT as Import_uld_wt

i want gross weight from table C and date from table B and ULD desc From table A and want to use JOBNO and JOB YR as composite key .

3 Replies
Not applicable
Author

Here is a thread that may be helpful

how to create composite key

Not applicable
Author

Hi

Composite key is just simple as this

autonumber(JOB_NO & JOB_YR)          as %K          // to build composite key as number

JOB_NO & '-' & JOB_YR          as Key     // to check key while developping

best regards

Chris

hic
Former Employee
Former Employee

I would use the following:

     Autonumber( JOB_NO & '|' & JOB_YR ) as CompositeKey

During the development, it can be good to remove the Autonumber() function, so you can see what the values are. But you should use it once you know that it it works.

HIC