Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Two independent tables and result in a single table

Hi all, I have stuck in one requirement . requirement is there are two tables suppose table 1 and table 2 . Table1 having Column Category,ID, Amt and Qty and other table2  which is independent table having only three columns such as ID,Category and Fixed amt which is Sales Amt my requirement is that we want to show same data as table2 in one resultant table and there is no relation between them . fields name are same but table 2 is independent table. Please find attached XL for your reference. Please help me out to achieve this requirement on urgent basis. Any help will be appreciated. Thanks in advance. Regards, deepak

Message was edited by: Deepak Kumar

8 Replies
vardhancse
Specialist III
Specialist III

Hi,

In Qlik automatically the join will happen based on common field name which you already might know.

But as per your requirement,

Try to load table 2 first and then do left join (table 2) for table 1

sushil353
Master II
Master II

Hi,

as per your output.. you can simply concatenate these two table.

Table:

Load *,1 as T_Flag from table1;

load Category,ID,SalesAmt as Amount,SalesAmt as Qty,2 as T_Flag

from table2;

HTH

Not applicable
Author

Sasi, I do not want to join  because It is independent data table i want to show the table 2 data as it is in the output of first table and for that i can use Qualify in the table 2 so that there is no relation occurs in between them but i want ouput in one straight table same as in the attchement. Thanks, deepak

Not applicable
Author

Sushil, Thanks for suggestion. I can not concatenate beacuse structure of table is different there are other fields also in the table which I not mentioned in the requirements but I want table 2 data in one resultant table. Thanks, Sushil

vardhancse
Specialist III
Specialist III

Correct.

Both tables have same structure, you want to make it into one single table.

But both don't have any relation.

Once can try concatenate table will work out for your requirement.

Based on common column it will concatenate

Not applicable
Author

Sasi, if I do the left join in between the tables than output is not achieved because there is no ID is common between them and there is null ID value will come against the Category of table2 that i do not want I want it shows the same data as the table2 data in the output. Thanks deepak

sushil353
Master II
Master II

to show the output you can concatenate the desired column into the table and also by using T_flag you can distinguish between the source of the two tables as well

Not applicable
Author

Sushil, Table 1 having other columns also as I told earlier only two or three columns are same in table because structure of both table is different  not the same here in the requirement I had given 4 columns in table1 and 3 in table2. Thanks, deepak