Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Not applicable

Create new field based on existing fields

Hi there,

I need to create a new field (Distributor) based on two existing fields ( Disti_Name , Disti_Corp_ID) with the condition shown in table below.

Is there any way to do this other than hard code?

Disti_Name

Disti_Corp_ID

Distributor

A_B

A B

AB

A_C

A C

AC

A_D

A D

AD

thanks!

2 Replies
felipedl
Valued Contributor III

Re: Create new field based on existing fields

Hi Alice,

You could do it in two ways:

1: create during the table load statement a concatenation of the two fields, something like

x:

load * Inline

[

  Disti_Name,Disti_Corp_ID,Distributor

  A_B,A B,AB

  A_C,A C,AC

  A_D,A D,AD

];

NoConcatenate

Data:

Load

  Disti_Name,

  Disti_Corp_ID,

  Distributor,

Disti_Name & '|' & Disti_Corp_ID as Key_LoadStatement

Resident x;

drop table x;

Or create a table with the expression:

"=Disti_Name & Disti_Corp_ID"

Attached is a QVW with both options.

Regards,

Felipe. !

Not applicable

Re: Create new field based on existing fields

Thanks Felip. Will test on this and update here.

Community Browser