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

Merging tables with different fields

Hi,

I have two fields as below:

NameValue
Agreement_No0000005238;ABC;123
Agreement_Desc0000001234;PQR;456
Agreement_Amt0000009876;XYZ;789

the first field is Descriptions and the second field is values.

I have separated descriptions to a separate table as below using script

Agreement_NoAgreement_DescAgreement_Amt
1--
-2-
--3

I have separated values to a separate table  as below using script

field 1field 2field 3
0000005238ABC123
0000001234PQR456
0000009876XYZ789

Now, my final output should be as below. How can i achieve this?

I have tried using Concatenate but that does not help.

Agreement_NoAgreement_DescAgreement_Amt
0000005238ABC123
0000001234PQR456
0000009876XYZ789

Regards,

Vishal

6 Replies

Re: Merging tables with different fields

Look at this example

Not applicable

Re: Re: Merging tables with different fields

Thanks for the response Yuri. I have field descriptions in one column and field values in another column. Using those two fields i am trying to create a table in Qlikview.

Your out treats everything as data.

Sc.jpg

Instead of having Table.A, TESTE, TESTE2 as column headers. I want Agreement_No, Agreement_Desc, Agreement_Amt as column header and the value in TESTE2 field above arranged as below.

Agreement_NoAgreement_DescAgreement_Amt
0000005238ABC123
0000001234PQR456
0000009876XYZ789

I am attaching the file, that i have used.

Please let me know your thoughts.

Vishal

Re: Re: Re: Merging tables with different fields

Ok, try this!

Not applicable

Re: Merging tables with different fields

Hi Yuri,

That works perfect but just one more thing in here.

It works fine for static structure but flat file will have structure that will change depending on scenario.

for instance the flat file might have additional field and value.

EX:

NameValue
Agreement_No0000005238;ABC;123;Jan
Agreement_Desc0000001234;PQR;456;Feb
Agreement_Amt0000009876;XYZ;789;Mar
Period0000001024;DEF;999;Apr

In such case, my output should be as below without changing the script:

Agreement_NoAgreement_DescAgreement_AmtPeriod
0000005238ABC123Jan
0000001234PQR456Feb
0000009876XYZ789Mar
0000001024DEF999Apr

Please advice.

Thanks,

Vishal

Not applicable

Re: Re: Merging tables with different fields

This is how i was able to achieve it. PFA file.

Thanks a lot Yuri!.

Vishal

Re: Merging tables with different fields

Very good!

Community Browser