Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
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

Re: Add column to data table

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

Re: Add column to data table

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

]

;

neetha_p
Honored Contributor

Re: Add column to data table

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

Community Browser