Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Bringing 2 tables together with similar structure

Hi

In our company we have branches that operate independently however they have the same structure.  I want to combine the 2 difference data source.

Attached herewith is the mock model which are link to 2 data sources.   The one is Joburg and the other is Durban.

The are 3 tables for each data source.

1. Sales Data:           Containing Customer, Item Code and Sales Qty

2. Customer Data:  Customer and Customer Group

3.Item Data:              Item Code and Item Category

When I reloaded the model, ITEM Category, Customer Group and “Renewable” under Division does not appear for Durban.  Please can you tell me where I am going wrong in my scripting.

Kind regards

Nayan

Tags (1)
1 Solution

Accepted Solutions
greeshma_k
Contributor III

Re: Bringing 2 tables together with similar structure

Hi Nayan,

Please check now.

Regards,

Greeshma

14 Replies
greeshma_k
Contributor III

Re: Bringing 2 tables together with similar structure

Hi,

You need to concatenate the tables first and then apply the joins. PFA.

Regards,

Greeshma

Not applicable

Re: Bringing 2 tables together with similar structure

Hi Greeshma

I have tried that. I got the Item Category to show, however the customer group is not showing. See attached.

Kind regards

Nayan

Not applicable

Re: Bringing 2 tables together with similar structure

Hi Greeshma

Sorry, did not see your file attached. I was working off my work email.  Will look at your model.

regards

Nayab

Not applicable

Re: Bringing 2 tables together with similar structure

Hi Greeshma

Thank you for your reply.  On your model, Item Category is not displaying.

kind regards

Nayan

greeshma_k
Contributor III

Re: Bringing 2 tables together with similar structure

Hi Nayan,

Sorry i missed that. Let me check.

Regards,

Greeshma

greeshma_k
Contributor III

Re: Bringing 2 tables together with similar structure

Hi Nayan,

Please check now.

Regards,

Greeshma

Not applicable

Re: Bringing 2 tables together with similar structure

Hi Greeshma

It worked . Thank you. Can you explain the joins / concatenate functions.

For the Joburg Customer & Item Data Tables, you don’t say Concatenate . However for the Durban Customer & Item Data Field you say Concatenate. Also would like to know to which table is this concatenation.

Kind regards

Nayan

Not applicable

Re: Bringing 2 tables together with similar structure

Hi,

Try this script.

[Jhb Source Data]:

LOAD [Data Source],

     Customer,

     [Item Code],

     [Sales Qty]

    

FROM

[Jhb Source Data (combine tables).xlsx]

(ooxml, embedded labels, table is [sales data]);

add

LOAD [Data Source],

     Customer,

     [Item Code],

     [Sales Qty]

FROM

[Durban Source Data (combine tables).xlsx]

(ooxml, embedded labels, table is [sales data]);

greeshma_k
Contributor III

Re: Bringing 2 tables together with similar structure

Hi Nayan,

Since the columns are for the tables are the same in both the data sources, I have first concatenated the similar tables. So, first I am loading Joburg Sales Data and concatenating Durban Sales Data to this table. Next I have loaded Customer  Data for Joburg and conctenated Customer Data for Durban to this table. Similarly for Item data. Once this is done you will have 3 tables i.e. Sales, Customer  and Item. These 3 tables will have data from both the sources. Once the data for similar tables are brought together, the joins are performed. This will work even if you don't give the concatenate command, as tables will same column names will get auto concatenated.

Regards,

Greeshma

Community Browser