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 a column to a table

Hi !

I have a table : Table1 which contains many informations like ID, date, name ... and another one : Table2 which contains the ID and the weight.

I would like to add, for each ID of the first table, the weight.

I tried with this script but it creates new rows in table1 and i don't know why. I want to keep the same number of row in table 1.

INNER JOIN (Table1)

LOAD

           ID,

          weight

RESIDENT Table2;

Thank you for your help.

1 Solution

Accepted Solutions

Re: Add a column to a table

Perhaps you need to use the distinct keyword:

INNER JOIN (Table1)

LOAD DISTINCT

           ID,

          weight

RESIDENT Table2;


talk is cheap, supply exceeds demand
3 Replies
MVP
MVP

Re: Add a column to a table

Check if your second table shows several weight values per ID (maybe only for some of the IDs).

You probably should clean your data first then use a join or a MAPPING approach.

Re: Add a column to a table

Perhaps you need to use the distinct keyword:

INNER JOIN (Table1)

LOAD DISTINCT

           ID,

          weight

RESIDENT Table2;


talk is cheap, supply exceeds demand
er_mohit
Honored Contributor II

Re: Add a column to a table

see attached file

here

i think the valuein your name and date field having null for some ID

therfore it showing you

Community Browser