Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
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
nicolett_yuri

Look at this example

Not applicable
Author

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

nicolett_yuri

Ok, try this!

Not applicable
Author

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
Author

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

Thanks a lot Yuri!.

Vishal

nicolett_yuri

Very good!