Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone.
I'm faced with a new challenge, in which i find a lot of interest.
The fact tables share a many to many relationship so i created a link table for them which I will provide.
I would like to create a common date bridge table using the KeyDate logic, but now the tables are not joined.
How should i do this?
The script so far is:
TempMasterfactTable:
LOAD *,
floor("Date1")&'|'&floor("Date2")&'|'&floor("Date3")&'|'&floor("Date4")&'|'&floor("Date5") as KeyDate
Resident TempMasterfactTable1;
Drop Table TempMasterfactTable1;
Date_Bridge:
Load KeyDate,
date(SubField(KeyDate,'|',1)) as CanonicalDate,
'DateType1' as DateType;
Load FieldValue('KeyDate',RecNo()) as KeyDate
AutoGenerate FieldValueCount('KeyDate');
Concatenate(Date_Bridge)
Load KeyDate,
date(SubField(KeyDate,'|',2)) as CanonicalDate,
'DateType2' as DateType;
Load FieldValue('KeyDate',RecNo()) as KeyDate
AutoGenerate FieldValueCount('KeyDate');
Concatenate(Date_Bridge)
Load KeyDate,
date(SubField(KeyDate,'|',3)) as CanonicalDate,
'DateType3' as DateType;
Load FieldValue('KeyDate',RecNo()) as KeyDate
AutoGenerate FieldValueCount('KeyDate');
Concatenate(Date_Bridge)
Load KeyDate,
date(SubField(KeyDate,'|',4)) as CanonicalDate,
'DateType4' as DateType;
Load FieldValue('KeyDate',RecNo()) as KeyDate
AutoGenerate FieldValueCount('KeyDate');
Concatenate(Date_Bridge)
Load KeyDate,
date(SubField(KeyDate,'|',5)) as CanonicalDate,
'DateType5' as DateType;
Load FieldValue('KeyDate',RecNo()) as KeyDate
AutoGenerate FieldValueCount('KeyDate');
autonumber KeyDate;
Please help me on this, i am really stuck. Thank you in advance 🙂 It means a lot.
Hello 🙂
Does anyone have a hint for this case or a totally new approach?
That would help a lot. Thank you!
Hello @joioan did you get a solution to this. I am experiencing the same challenge. I have two tables with different dates and need a common filter to affect the two.
In many common scenarios it's not necessary to create link-tables else it's more suitable to concatenate the facts by harmonizing the field-names and data-structure as much as possible.
Data like actual & budget & forecast are mainly the same as well as order & billing & shipment - only the point of view is different ...
Thanks for your response.
For my exact scenario, I have Loan information and Customer Registration. From Loans, I have the issue date and from Customer I have the registration Date. The goal is to have a common Date which once filtered will affect both loans and customer information i.e A 2025 filter will return Loans Issued in 2025, and customers registered in the same year.
I have tried giving the same alias to the two dates then doing a concatenate as well as having a date bridge but the two approaches didn't work.
Could I be missing something?
I think the approach for the bridge-table is wrong - at least very uncommon. The usual way is the following:
bridge:
load distinct Key, DateX as Date from fact1;
concatenate(bridge)
load distinct Key, DateY as Date from fact2;
and the calendar is then linked to the bridge.