<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Help with a join between 2 fact tables in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Help-with-a-join-between-2-fact-tables/m-p/2461833#M98908</link>
    <description>&lt;P&gt;I have 2 fact tables which hold data related by an ID field where it's available in both tables.&lt;/P&gt;
&lt;P&gt;Each table has a datetime field which if the ID exists in both tables can differ by a few minutes to a few hours between. It's possible to have several records per ID in both tables with different datetime stamps.&lt;/P&gt;
&lt;P&gt;The ID is not necessarily in both tables. It can just be in Fact1 or just be in Fact2.&lt;/P&gt;
&lt;P&gt;The ID field is repeated in both tables after a period of time (usually around 10 weeks, but can be fewer or more weeks). This pattern repeats, so over a period of a year, it's possible that the data will repeat 5-6 times.&lt;/P&gt;
&lt;P&gt;My challenge is to try and match the pairs of data, based on the ID, and both dates being within 24 hours of each other.&lt;/P&gt;
&lt;P&gt;The datasets are large (approx. 2.5m rows for 3 months in each table).&lt;/P&gt;
&lt;P&gt;Can anyone suggest a way that I can join the data using a date range in the key? I've tried Interval Match (creating a [Fact2 End Date] by adding 1 day on to [Fact1 Date] :&lt;/P&gt;
&lt;P&gt;NoConcatenate&lt;/P&gt;
&lt;P&gt;Fact1Match:&lt;BR /&gt;Load *&lt;BR /&gt;Resident Fact1;&lt;/P&gt;
&lt;P&gt;Fact2Match:&lt;BR /&gt;Load *&lt;BR /&gt;Resident Fact2;&lt;/P&gt;
&lt;P&gt;IntervalMatch:&lt;BR /&gt;IntervalMatch ([Fact2 Date])&lt;BR /&gt;Load distinct [Fact1 Date], [Fact1 End Date] &lt;BR /&gt;Resident Fact1;&lt;/P&gt;
&lt;P&gt;This works where there is a match, but what I need is something that also works where we only have data in one table of the other.&lt;/P&gt;
&lt;P&gt;I also tried concatenating the two fact tables into one, but this caused other issues, and I ended up with multiple rows even where the ID matched one record on each fact table.&lt;/P&gt;
&lt;P&gt;Can anyone help please?&lt;/P&gt;
&lt;P&gt;Many thanks.:)&lt;/P&gt;</description>
    <pubDate>Wed, 12 Jun 2024 16:54:03 GMT</pubDate>
    <dc:creator>Jubline</dc:creator>
    <dc:date>2024-06-12T16:54:03Z</dc:date>
    <item>
      <title>Help with a join between 2 fact tables</title>
      <link>https://community.qlik.com/t5/App-Development/Help-with-a-join-between-2-fact-tables/m-p/2461833#M98908</link>
      <description>&lt;P&gt;I have 2 fact tables which hold data related by an ID field where it's available in both tables.&lt;/P&gt;
&lt;P&gt;Each table has a datetime field which if the ID exists in both tables can differ by a few minutes to a few hours between. It's possible to have several records per ID in both tables with different datetime stamps.&lt;/P&gt;
&lt;P&gt;The ID is not necessarily in both tables. It can just be in Fact1 or just be in Fact2.&lt;/P&gt;
&lt;P&gt;The ID field is repeated in both tables after a period of time (usually around 10 weeks, but can be fewer or more weeks). This pattern repeats, so over a period of a year, it's possible that the data will repeat 5-6 times.&lt;/P&gt;
&lt;P&gt;My challenge is to try and match the pairs of data, based on the ID, and both dates being within 24 hours of each other.&lt;/P&gt;
&lt;P&gt;The datasets are large (approx. 2.5m rows for 3 months in each table).&lt;/P&gt;
&lt;P&gt;Can anyone suggest a way that I can join the data using a date range in the key? I've tried Interval Match (creating a [Fact2 End Date] by adding 1 day on to [Fact1 Date] :&lt;/P&gt;
&lt;P&gt;NoConcatenate&lt;/P&gt;
&lt;P&gt;Fact1Match:&lt;BR /&gt;Load *&lt;BR /&gt;Resident Fact1;&lt;/P&gt;
&lt;P&gt;Fact2Match:&lt;BR /&gt;Load *&lt;BR /&gt;Resident Fact2;&lt;/P&gt;
&lt;P&gt;IntervalMatch:&lt;BR /&gt;IntervalMatch ([Fact2 Date])&lt;BR /&gt;Load distinct [Fact1 Date], [Fact1 End Date] &lt;BR /&gt;Resident Fact1;&lt;/P&gt;
&lt;P&gt;This works where there is a match, but what I need is something that also works where we only have data in one table of the other.&lt;/P&gt;
&lt;P&gt;I also tried concatenating the two fact tables into one, but this caused other issues, and I ended up with multiple rows even where the ID matched one record on each fact table.&lt;/P&gt;
&lt;P&gt;Can anyone help please?&lt;/P&gt;
&lt;P&gt;Many thanks.:)&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 16:54:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Help-with-a-join-between-2-fact-tables/m-p/2461833#M98908</guid>
      <dc:creator>Jubline</dc:creator>
      <dc:date>2024-06-12T16:54:03Z</dc:date>
    </item>
  </channel>
</rss>

