Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
rubinsky
Contributor II
Contributor II

Problem with Keys among 4 tables

I have 4 tables:

Budgets

Amounts

Stats

AccountComponents

Budgets, Amounts, and Stats each have the same fields AccountID, MonthDT, YearDT, and AccountIDKey

AccountIDKey  is a concatenation of AccountID, MonthDT, and YearDT. 

AccountComponets has AccountID as it's field.  How can I keep Budgets, Amounts, and Stats "linked" together via AccountIDKey and link AccountCompoents to those three tables by AccountID?

-jdr

1 Solution

Accepted Solutions
Miguel_Angel_Baeyens

Hi,

Think of something like this

Facts:

LOAD *,

     'Budget' AS Fact_Type

FROM BudgetsTable;

CONCATENATE (Facts) LOAD *,

     'Stats' AS Fact_Type

FROM StatsTable;

CONCATENATE (Facts) LOAD *,

     'Amounts' AS Fact_Type

FROM AmountsTable;

Components:

LOAD *

FROM AccountComponentsTable;

So all facts (things that happen between dates, in this case: Budgets, Amounts, Stats) are in the same table, a fact table, and the AccountComponents is linked as a dimension table.

Hope that helps you on the development.

Miguel

View solution in original post

1 Reply
Miguel_Angel_Baeyens

Hi,

Think of something like this

Facts:

LOAD *,

     'Budget' AS Fact_Type

FROM BudgetsTable;

CONCATENATE (Facts) LOAD *,

     'Stats' AS Fact_Type

FROM StatsTable;

CONCATENATE (Facts) LOAD *,

     'Amounts' AS Fact_Type

FROM AmountsTable;

Components:

LOAD *

FROM AccountComponentsTable;

So all facts (things that happen between dates, in this case: Budgets, Amounts, Stats) are in the same table, a fact table, and the AccountComponents is linked as a dimension table.

Hope that helps you on the development.

Miguel