Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How many fact tables will be there in star schema?

How many fact tables will be there in star schema?if it is more then one how to make them connected.

17 Replies
Not applicable
Author

Hi,

Star schema contains only one fact table.

If you have morethan one fact table then if you are going to imploment star schema then concatinate the fact tables into 1 fact table.

Just like this

load * from fact1;

concatenate

load * from fact2;

concatenate

load * from fact3;

its_anandrjs

There is only one fact table in the Star schema if you have to use more than one then use the link tables in between them which is used as the reference table.

Regards,

Anand

vardhancse
Specialist III
Specialist III

As per Star Schema,,will say only one fact table.

But in real time don't think only one fact table was possible.

We can join multiple fact tables in to single table.

Not applicable
Author

Thank you Anand,

can you please give me any simple example with sample date how two fact tables will be linked and how can we test combination of links while testing data integrity like combination can i get total output data.

Not applicable
Author

Hi Sasi,

i have one query is it posiible to make  join bw two facts?if it is can u please give sample example.

vardhancse
Specialist III
Specialist III

Hi,

We can join 2 fact tables.

ABC:

LOAD

A,

B,

C

From Table_1;

Left join(ABC)

LOAD

A,

D,

E

From Table_2;

jagan
Luminary Alumni
Luminary Alumni

Hi Venu,

Generally there is one fact table and n dimension tables surrounding it, if you have more than one Fact table, then you can convert to one fact table using concatenate like below

TransactionData:

LOAD

ProductID,

BranchID,

Sales,

'Sales' AS Flag

FROM FactTable1;

Concatenate(TransactionData)

LOAD

ProductID,

BranchID,

Budget,

'Budget' AS Flag

FROM FactTable2;

Product:

LOAD

*

FROM PRoduct;

Branch:

LOAD

*

FROM Branch;

Or if both are different data then try to generate the data model like below

galaxy.jpg

Regards,

Jagan.

Not applicable
Author

Hi Jagan

Thank u so much,

can u please give me clarification about flags.'Sales' as flag?????(why this).

jagan
Luminary Alumni
Luminary Alumni

Hi,

Flags are used to identify from which Source table the record belongs to, if you don't have this flag you don't have any clue from which table particular row belongs to, since we are concatenating multiple tables.  It is a good practice to arrive a flag in script, latest it would be very useful for troubleshooting if there is any issues.

If you got the answer please close this thread by giving Correct Answer to the useful post.

Regards,

Jagan.