Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Trying to upload multiple Fact Tables

Hi guys, I am new to Qlikview and I am having some troubles while trying to load data from multiple fact tables. My scenario is as following:

I need to get information from 4 different fact tables, they share the same dimensions, I´ve tried to use CONCATENATE but it is duplicating the values of my metrics. Any ideas?

Thanks in advance for your support.

1 Solution

Accepted Solutions
ramoncova06
Partner - Specialist III
Partner - Specialist III

I normally use a hardcoded "source" field when joining fact tables, then you can use that as part of your set analysis

Table1:

load

*,

'Table1' as Source

from ....

;

Table2:

load

*,

'Table2' as Source

from ....

;

in the front end change the expression to a set analysis

COUNT( distinct {<Source ={'Table1'} >}CourseKey)


that way you can separate each fact

View solution in original post

7 Replies
Clever_Anjos
Employee
Employee

Could you describe your fields and tables?

boorgura
Specialist
Specialist

Make sure you are not declaring new table names.

Check the internal table view(Ctrl+T on a desktop client or IE plugin version) to make sure all 4 FACTs are indeed concatenated into a single table.

Code should be like this:

TableName:

LOAD ..

...

..

from source1;

concatenate

LOAD ...

...

..

...

...

from source 2;

...

...

..

If you happen to include any other loads in between - try using concatenate(TableName)

karthikoffi27se
Creator III
Creator III

Hi Clark,


Try using qualify and unqualify function which will add the table names in front of your field names for all the four tables leaving out your Primary key.


For eg:


Qualify *;

Unqualify PRODUCT_KEY;


SalesTable:

Load

PRODUCT_KEY,

FIXED_COST,

VARIABLE_COST,

TOTAL_COST

From Sales.qvd

;

CostTable:

Load

PRODUCT_KEY,

FIXED_COST,

VARIABLE_COST,

TOTAL_COST

From Cost.qvd

;


Unqualify *;



Hope this helps.


Many Thanks

Karthik

Not applicable
Author

Thanks everyone for your quick responses.

The Concatenate has worked for me partially, because I need a DISTINCT Count of a column, so when I concatenate my tables, I use the DISTINCT Count just to remove the duplicates from the concatenation, but not the duplicate values in the column, so what I basically need is something as follows: COUNT(DISTINCT(COUNT(DISTINCT CourseKey) --- I know this syntax has not much sense but I can't figure out a way of getting my Distinct values.

ramoncova06
Partner - Specialist III
Partner - Specialist III

I normally use a hardcoded "source" field when joining fact tables, then you can use that as part of your set analysis

Table1:

load

*,

'Table1' as Source

from ....

;

Table2:

load

*,

'Table2' as Source

from ....

;

in the front end change the expression to a set analysis

COUNT( distinct {<Source ={'Table1'} >}CourseKey)


that way you can separate each fact

Not applicable
Author

It works perfectly Ramon! Just confirming what it is doing internally... By using the set analysis I am specifying that I want Qlikview to make the Distinct Count from the information in <Source={'Table1'} table only right?

Thank you very much

ramoncova06
Partner - Specialist III
Partner - Specialist III

correct, that is how QV is handing it