Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to deal with more than two fact all with different columns and keys

Hello Experts,

I have four fact tables and all having different keys and columns. I want to make all four fact tables as single fact table as to achieve star model.

Here which method I have to choose.

Is concatenating all four fact tables or by using link table.

Please guide me on this issue.

Regards,

Kumar

11 Replies
kuczynska
Creator III
Creator III

If that's truly what I want to do - you would have to join your tables or concatenate them. It all depends on what columns you have in each table - If you want to bring new columns, you will have to use join (or keep, with an additional prefix left/right/inner/outer depending what's the data you want to have at the end of this transformation process). If you only want to bring a small number of columns - create mapping tables and ApplyMap() in the destination table.

However - concatenate will bring across new rows. If the structure between two (or more tables) is exactly the same - QV will concatenate them naturally, during the load script. But you mentioned that you already have 4 facts tables, which suggest they aren't the same and the columns contain different information (or possibly - they are called differently as they may be coming from various sources). You can of course force QV to concatenate two tables by adding Concatenate(destination_table_name).

It's very hard to advise what exactly you must do at this point - without knowledge how your tables look like or knowing which one should be use as the final facts table (considering the size, information that holds, etc...) it's a difficult task.

As few people before me mentioned already - is there a special reason you want to perform this operation? If the performance isn't an issue for you, I'm not sure what exactly you are trying to achieve.

Gysbert_Wassenaar

I have to build a star schema with four fact tables and four dimensions.

Why? Is somebody going to spank you if you don't? Or do you have a technical reason you have to do this?


talk is cheap, supply exceeds demand