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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Add column to data table

hi all,

I have a table contains two columns

Size  Length

1      2

in Script i want to add to this data table a column from another table: Department

Department

A

B

The result should be:

Department     Size     Length

A                    1          2

B                    1          2

how can I do that?

Thanks in advance

3 Replies
its_anandrjs
Champion III
Champion III

Hi,

Load Size, Length,1 as Dummy;

Load * inline [

Size, Length

1    ,  2   ];

Join

Load Department,1 as Dummy;

Load * Inline  [

Department

A

B  ];

Regards

Anand

Not applicable
Author

You can perform a join (INNER, LEFT, RIGHT).

The join is a Natural Join made over all the common Fields (where the field name is the same).

If your two tables do not share a common field as you above example you can use the JOIN prefix to get your desired result. See below

Table1:

LOAD * INLINE

[

Size, Length

1 ,  2

]

;

JOIN

LOAD * INLINE

[

Field 

A

B

]

;

Anonymous
Not applicable
Author

hi Jacob,

Use applymap () by using if any matching column :

ProductMap:

Mapping Load

ProductID

ProductName

from Table1;

Table3:

Load

ApplyMap(' ProductMap ' ProductName ) as ProductID,

ProductName ,

ProductDescription

from Table2;


Regards

Neetha