Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Pujitha
New Contributor

Script

Hi,

I have 4 files which I need to concatenate to one. In one file I have like

Name   Opt  loc  Cod    id    dig      Lb     .Gop.      ....... some other columns

code     0         0         24     1    exx    .....         .....         .....

prof       1        0         43     2     xer    ....          ...            ..

stud      0        0        34      3     iop     ....        ...              ....

Another table:

loc     Cod   Lb  id  gop(as op) ..............here  and so on other columns 

diff data in Lb column

another table:

Et   loc    Cod    Lb    id 

another table:

Et st  status  Lb  id  loc

I need to append all these tables to one pls let me know this clearly from start to end how to do. Please let me know asap

7 Replies
lockematthewp
Contributor II

Re: Script

After loading those files, QlikView will automatically connect them based on matching column names. If you want to remove some of the connections (like to remove synthetic keys), just change the script with the as keyword like:

Load [Name],

       [Opt] as Whatever,

      ….. 

Pujitha
New Contributor

Re: Script

Can you make it little clear. If I load all the files it will come as single file??

lockematthewp
Contributor II

Re: Script

They will still be 4 separate tables. But QlikView will automatically make associations between them wherever the column names match. You can load them all and then press CNTRL + T and it will show you a picture of how the tables are connected. There is really no need to put them all in one table as QlikView will pretty much treat it that way anyways.

Pujitha
New Contributor

Re: Script

I am getting synthetic keys. I did concatenate between tables. Even though the column name is same for some but data is different.  

Support
Support

Re: Script

Pujitha, check out the following Design Blog post link, I think it will help you get your head wrapped around the synthetic keys.  

https://community.qlik.com/t5/Qlik-Design-Blog/Synthetic-Keys/ba-p/1472634

The other two functions that will likely come in handy to clean up the synthetic keys would be the following:

https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/Scripting/Scrip...

https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/Scripting/Scrip...

Hopefully that helps get you on the right track on this one.

Regards,
Brett

To help users find verified answers, please don't forget to mark a correct resolution or answer to your problem or question as correct.
marcus_malinow
Valued Contributor III

Re: Script

If you want the end result to be a single table, use forced concatenation

 

Table:

LOAD 

[field list]

FROM [Source 1]

 

CONCATENATE (Table)

Load 

[field list 2]

FROM [Source 2]

 

etc, etc.

Support
Support

Re: Script

Duplicate thread, see the following for other posts: https://community.qlik.com/t5/New-to-QlikView/scripting/m-p/1604193/highlight/false#M378198

Regards,
Brett

To help users find verified answers, please don't forget to mark a correct resolution or answer to your problem or question as correct.