Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
drewwilliams
Contributor III
Contributor III

Join, Link, Concat, ApplyMap, or all of the above?

Hello All,

I've read articles and seen examples of joins, link tables, concatenates, applymaps and dimension tables, but I haven't found an example that matches my situation. From reading about each of these it seems I may need to do a combination of them in order to correctly link my data. I have many fact tables with either 2 or 3 key fields in them. These fact tables are very large (most have tens of millions of rows). Here is a simplified version of each table.

Table1: |  Table2:    |    Table3:   |     Table4:     |   Table5:     |   Table6:    |  Table7:

Key1,   |   Key1,      |    Key1,     |      Key1,      |    Key2,      |    Key1,     |   Key1,

Key2,   |   Metric11, |    Metric13,|      Key3,      |    Key3,      |    Key3,     |   Key2,

Key3,   |   Metric12  |    Metric14,|      Metric16, |    Metric16, |    Metric19,|   Key3,

Metric1,|  Metric15   |                  |      Metric17, |   Metric17, |    Metric20 |   Metric21,

Metric2,|                 |                   |    Metric18   |    Metric18  |                  |  Metric22,

Metric3,|                 |                   |                    |                  |                 |   Metric23

Table1 details the parts that make up a product, so these Keys are not distinct. The other tables hold details about the parts (Key2) and products (Key1), sometimes depending on their location (Key3).

Each of these tables have many more fields (Metrics) in them but this is a simplified version to show where the keys are in each table.

I've considered a link table but I'm not sure how to create the key field when each table has a different number of keys in them.

Can anyone help me connect this table correctly as to keep metrics from duplicating/summing incorrectly and achieve optimal performance? (keep in mind, some of these tables have millions of rows in them) With this much data, synthetic keys will give me incorrect results.

I appreciate any help! Thank you!

I've attached a sample with some made up data using inline tables, however my data will be coming from QVDs. I've also tried to decrease the space between tables in the explanation in hopes that it formats correctly when published.



EDIT 1/29/16 - STILL LOOKING FOR HELP!

11 Replies
Gysbert_Wassenaar

That's pretty hard to read. Can you create a small qlikview document that illustrates the problem? Preferably with table and field names that say a little more about their purpose and content than TableX, KeyY and MetricZ. That will make it easier for us to make suggestions.


talk is cheap, supply exceeds demand
drewwilliams
Contributor III
Contributor III
Author

Hi,

Yes sorry, I tried to shrink it once before but I guess that did not work. I'll create a QVW real quick and edit the post. Thanks!

Not applicable

Can you please post a sample qvw with sample data so community will give best possible solution.

drewwilliams
Contributor III
Contributor III
Author

Sample data has been posted, some qty/ values may not make sense but the outline of the data should detail my current situation.

drewwilliams
Contributor III
Contributor III
Author

Sample data has been posted, some qty/ values may not make sense but the outline of the data should detail my current situation.

Not applicable

Can you explain how Inventory & BOM tables are related. You want to separate the Parts & products in differently ?

currently you have only Prod sales. Do you have separate sales table for Parts?

drewwilliams
Contributor III
Contributor III
Author

Sure! There are no sales for parts. For inventory, it depends on the location. At a location, there will be both Parts and Products separately with inventory.

For example, let's say a Pencil is made of a wood sleeve, metal eraser cap, rubber eraser, and a graphite stick.

In inventory there could be, 10 Pencils, 4 wood sleeves, 2 metal eraser caps, 8 rubber erasers, and 7 graphite sticks. So if you were going to make more pencils with the part inventory, you could make 2 more pencils since there are only 2 metal eraser caps. After making 2 more pencils, the inventory would look like:

Pencils 12

Metal eraser caps 0

Wood Sleeves 2

Rubber eraser 6

Graphite Sticks 6

While the BOM file would list the parts in 1 product.

Prod        Part                         Qty Parts in Prod

Pencil     Metal eraser cap               1

Pencil     Wood sleeve                     1

Pencil     Rubber Eraser                   1

Pencil     Graphite Stick                    1

Does this make sense?

drewwilliams
Contributor III
Contributor III
Author

Anybody have any ideas?

Gysbert_Wassenaar

Perhaps you can concatenate the Inventory and BOM tables. See attached example.


talk is cheap, supply exceeds demand