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

How to combine two sets of data without causing circular reference

Hi everyone,

I'm having 2 sets of different data that I'd like to have joined in one app.

These 2 sets have date and sites in common.

If I want to associate both sites and time I get a circular reference and this is causing me issue with the time dimension.

What's the best approach to handle this?

Thank you,

8 Replies
marinadorcassio1
Partner - Creator
Partner - Creator

Hi Simon,

May you give a schema or picture of your data model ? Because like this, it's hard to help you

Regards,;

Marina

YoussefBelloum
Champion
Champion

Hi,

like

I think you're talking about a Synthetic table..like Marina already mentioned above, try to add more info here

Gabriel
Partner - Specialist III
Partner - Specialist III

Hi Smon,

You have 2 approach I think you can use to avoid circular reference.

1- You can join on the fields common to both table and rename the remaining fields from the second table

2- You can concatenate both tables together. You will have to watch out for data volumes as this might slow down the script during concatenation. The other way round this is to have a placeholder fields in both table for fields not in each table. It helps to have a fields that identify source table. Example of this below

Tab1:

LOAD

fild1,

fild2,

fild3,

fild4,

NULL()                AS  fild6,

NULL()                AS  fild7,

NULL()                AS  fild8,

'Tab1'                   AS [Source]

FROM xxxxx ;

CONCATENATE(Tab1)

LOAD

fild6,

fild7,

fild8,

NULL()                AS  fild1,

NULL()                AS  fild2,

NULL()                AS  fild3,

NULL()                AS  fild4,

'Tab2'                   AS [Source]

FROM yyyyyy;

This will speed up the process.

Hope this is helpful.

Anonymous
Not applicable
Author

So here I have the 2 sets attached by a bridge table to "Usine".

If I want to associate the date field of  "Echantillon" to "Calendrier" I get the circular reference.Schema.png

Thanks!

marinadorcassio1
Partner - Creator
Partner - Creator

Simon,

Généralement ce sont les faits qui sont reliés au calendrier. Je pense qu'il faut que tu te poses la question de savoir si les tables ConsommationElectricité, DebitUsineJour et DébitUsineMois doivent bien être liées au calendrier.

Regards,

Marina

marinadorcassio1
Partner - Creator
Partner - Creator

Ou alors la solution la plus simple et efficace, c'est de renommer ton champs qui fait la liaison entre tes tables Client et Site. Est-ce que fonctionnellement le Client que tu lies à tes échantillons via PontReseau est le même que le Client lié au Site ?

Anonymous
Not applicable
Author

J'ai pensé faire une seule table avec Client et Site même si à la base les données sont différentes (elles ne font que partager le même groupe d'usine, le pourquoi elle sont attachées à la table pont). Mais je reviendrais avec le problème de circularité "grâce" à mon point réseau.

Merci de votre aide!

Anonymous
Not applicable
Author

Je dois avouer que j'ai beaucoup lu sur la dimension temps et je suis un peu confus.

Les 3 tables contiennent des informations par date. Exemple Consommation Électricité contient des consommations électriques ainsi que des coûts et des dates. Les tables de débits contiennent des débits avec des dates. On veut pouvoir calculer des coûts de débits en fonction des coûts d'électricité, le pourquoi nous voulons les joindres par une dimension temps.

Quelle serait la meilleure approche?

Encore une fois merci de votre aide!