Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
fredericlehner
Contributor III
Contributor III

Copy field from table to other table

Hi,

I've 2 tables. "Repairs" and "Sales" joined with "material_number AS MAT_NB" in "Repairs", "Mat_material AS MAT_NB" in "Sales".

In "Sales" table, the field "Pillar" must be copied in the "Repairs" table in load script where MAT_NB = MAT_NB.

Thanks for your help.

Regard's,Fred

Labels (3)
2 Solutions

Accepted Solutions
JordyWegman
Partner - Master
Partner - Master

Hi Frederic,

Try this:

MappingMAT_NB2Pillar:
Mapping Load
   MAT_NB,
   Pillar
Resident Sales;

Repairs
Load
    *,
    Applymap('MappingMAT_NB2Pillar',MAT_NB,'No match') as Pillar
From [YourRepairSource] (qvd)
;

Jordy

Climber

Work smarter, not harder

View solution in original post

JordyWegman
Partner - Master
Partner - Master

Hi Frederic,

Yes that is right! Cool, do you like the Vizlib extensions?

We use 'No match' argument so you can see what is not matched (correctly). So if there are any errors you can easily trace then, because if you leave it blank --> null(), you can't select them in your application to see which ones are incorrect.

Jordy

Climber

Work smarter, not harder

View solution in original post

5 Replies
JordyWegman
Partner - Master
Partner - Master

Hi Frederic,

Try this:

MappingMAT_NB2Pillar:
Mapping Load
   MAT_NB,
   Pillar
Resident Sales;

Repairs
Load
    *,
    Applymap('MappingMAT_NB2Pillar',MAT_NB,'No match') as Pillar
From [YourRepairSource] (qvd)
;

Jordy

Climber

Work smarter, not harder
fredericlehner
Contributor III
Contributor III
Author

Thanks Jordy !

You work in Climber, I see. I'm using VizLib 😉

I'ts work's, but why "no match" argument ?

Fred

JordyWegman
Partner - Master
Partner - Master

Hi Frederic,

Yes that is right! Cool, do you like the Vizlib extensions?

We use 'No match' argument so you can see what is not matched (correctly). So if there are any errors you can easily trace then, because if you leave it blank --> null(), you can't select them in your application to see which ones are incorrect.

Jordy

Climber

Work smarter, not harder
fredericlehner
Contributor III
Contributor III
Author

Thanks Jordy.

Yes, i'm used and like VizLib extensions, thanks.

As you are familiar with VizLib, a question about filters with Applymap.

When I create a VizLib filter with the Pillar dimension of Applymap, (dimension present in both tables) I have incorrect results because of the Pillar dimension on the 2 tables certainly.

How to filter on only the table where I added the field Pillar with Applymap or to avoid in the filter or the KPI the dimension Pillar Source?

Thanks Jordy !

JordyWegman
Partner - Master
Partner - Master

Then you probably also have a synthetic key in your data model. Try to rename the new field to [YourTableName].Pillar. Here you fill in your table name, then the dot '.' followed by the Pillar name. This will resolve the problem.

Jordy

Climber

Work smarter, not harder