Book Image

Mastering QlikView

By : Stephen Redmond
Book Image

Mastering QlikView

By: Stephen Redmond

Overview of this book

Table of Contents (14 chapters)
Mastering QlikView
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Dealing with multiple fact tables in one model


In data models designed around business processes, we will often have just one source fact table. If we have additional fact tables, they tend to be at a similar grain to the main fact table, which is easier to deal with. Line-of-business documents may have fact tables from lots of different sources that are not at the same grain level at all, but we are still asked to deal with creating the associations. There are, of course, several methods to deal with this scenario.

Joining the fact tables together

If the fact tables have an identical grain, with the exact same set of primary keys, then it is valid to join, using a full outer join, the two tables together. Consider the following example:

Fact:
Load * Inline [
Date, Store, Product, Sales Value
2014-01-01, 1, 1, 100
2014-01-01, 2, 1, 99
2014-01-01, 1, 2, 111
2014-01-01, 2, 2, 97
2014-01-02, 1, 1, 101
2014-01-02, 2, 1, 98
2014-01-02, 1, 2, 112
2014-01-02, 2, 2, 95
];

Join (Fact)
Load * Inline...