Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I created a link table because I have a few fact tables. I needed the data to be connected and avoide synthetic keys and circular references. But now there are no errors to the link table script but I am not able to view the data I need and it appears not to be linked at all. Can someone help guide me please.
Link_table:
LOAD DISTINCT
[linkKey],
draw_id,
game_code
RESIDENT fact_sales_hourly_agg;
CONCATENATE(Link_table)
LOAD DISTINCT
[linkKey],
draw_id,
game_code
RESIDENT fact_winners;
CONCATENATE(Link_table)
LOAD DISTINCT
[linkKey],
draw_id,
game_code
RESIDENT fact_pl_agg;
CONCATENATE(Link_table)
LOAD DISTINCT
[linkKey],
draw_id
RESIDENT fact_sales_liability;
CONCATENATE(Link_table)
LOAD DISTINCT
[linkKey],
draw_id
RESIDENT fact_draw_numbers;
CONCATENATE(Link_table)
LOAD DISTINCT
[linkKey],
game_code
RESIDENT dim_game;
//drop fields from initial QVD load scripts these data fields are no longer needed
DROP FIELDS
draw_id,
game_code
FROM fact_sales_hourly_agg;
DROP FIELDS
game_code,
draw_id
FROM fact_winners;
DROP FIELDS
draw_id,
game_code
FROM fact_pl_agg;
DROP FIELDS
draw_id
FROM fact_sales_liability;
DROP FIELDS
draw_id
FROM fact_draw_numbers;
DROP FIELDS
game_code
FROM dim_game;
Example of code that I added the link key to in the table:
LOAD
draw_id&'|'&game_code AS [linkKey], //for linktable
draw_id,
game_code,
FROM [lxxxxxx/fact_sales_hourly_agg.qvd]
(qvd);
Yes you're right. I removed the link table and created the link in SQL instead
Hello @chibi
I'm not a big fan of link tables when you have several facts.
I prefer to concatenate (like a sql union) the fact in one Table? It's easy to understand, easy to maintain and fast. Have you tried this approach ?
Best regards,
Simon
Yes you're right. I removed the link table and created the link in SQL instead