Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Create a new field with data in script

Hi All,

Is there a way to create a new field with data values in them in the Script? 

My example is this.  I have 3 lists (sharepoint. List 1, List 2, list 3) being pulled.  List 1 is the main List that has a Legal name as the key field.  List 2 and 3 all are linked via the Legal Name.  I also have a field in the lists called Title Name that basically tells me which list i am pulling from, be it List 2 or List 3 yet list 1 does not have this field.  How can I combine the Title lists in List 2 and 3 into list 1? Or combine the lists all together so I can click and sort by them.  If I change all the Title Lists to the same field name it becomes another key field which i do not want to do.

Any help is greatly appreciated.

Nick

1 Reply
MVP & Luminary
MVP & Luminary

Re: Create a new field with data in script

It depends on your data and what you want. You can join the list tables or maybe you can use mapping tables and the applymap function.

You could use the join statement to join the tables into one table. You can then use the fields in the combined table to create new fields. Something like this:

List1:

Load

LegalName, fieldB, fieldC, ..etc

from ...list1...;

join

Load

LegalName, fieldP, fieldQ, ..etc

from ...list2...;

join

Load

LegalName, fieldX, fieldY, ..etc

from ...list3...;

ResultTable:

Load

LegalName,

fieldP & '-' & fieldX as fieldPX,

fieldA, fieldB, fieldP,...etc

resident List1;

drop table List1;


talk is cheap, supply exceeds demand