<?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 Interval match with both date and time in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Interval-match-with-both-date-and-time/m-p/868044#M656457</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm fairly new to Qlik and I'm trying to build up my data model.&lt;/P&gt;&lt;P&gt;My data model is made mainly with slowly changing dimensions, which I have combined into one 'Sub intervals' table (Based on the partitioning solution in &lt;A href="https://community.qlik.com/docs/DOC-4310"&gt;IntervalMatch and Slowly Changing Dimensions&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically my end result is being able to choose a point in time, and see the state of my members based on the different slowly changing dimensions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was able to get this to work, however it was quite heavy and the solution affected performance even when I only had about 5% of the data load I'll have eventually...&lt;/P&gt;&lt;P&gt;I figured a big cause for this was the fact that I kept all my dates in a timestamp format of 'yyyy-MM-dd hh:mm:ss' meaning that had a lot of different entries on the calendar table for the same date ( which caused problems in normalizing and compacting the date).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I decided to split my periods from a column for "From_datetime" and a column for "To_datetime", to 4 columns:&lt;/P&gt;&lt;P&gt;[From_date],&lt;/P&gt;&lt;P&gt;[From_Time],&lt;/P&gt;&lt;P&gt;[To_date],&lt;/P&gt;&lt;P&gt;[To_Time]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However I'm stuck on the step where I do the interval match between my sub intervals and the original slowly changing dimensions:&lt;/P&gt;&lt;P&gt;This is the code I had which worked, before the separation of date and time. Note that EXTERNAL_ID is a unique persons ID which is linked to each period.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;// ============ Create the bridge table between the subintervals and the TRANS ============&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Tmp_TRANS_BridgeTable:&lt;/P&gt;&lt;P&gt;IntervalMatch (SubIntervalBegin, EXTERNAL_ID)&lt;/P&gt;&lt;P&gt;Load distinct FROM_DATE, TO_DATE, TmpEXTERNAL_ID as EXTERNAL_ID resident TRANS;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TRANS_BridgeTable:&lt;/P&gt;&lt;P&gt;Load &lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt;EXTERNAL_ID &amp;amp; '|' &amp;amp; FROM_DATE &amp;amp; '|' &amp;amp; TO_DATE as TRANS_ID,&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; EXTERNAL_ID &amp;amp; '|' &amp;amp; SubIntervalBegin as SubIntervalID&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Resident Tmp_TRANS_BridgeTable;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I now have separated the subintervals table to have instead of a [SubIntervalBegin] column, have 2 columns for:&lt;/P&gt;&lt;P&gt;[SubIntervalBeginDate], [SubIntervalBeginTime]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure how to update my script. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks beforehand &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Jun 2015 07:14:14 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-06-11T07:14:14Z</dc:date>
    <item>
      <title>Interval match with both date and time</title>
      <link>https://community.qlik.com/t5/QlikView/Interval-match-with-both-date-and-time/m-p/868044#M656457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm fairly new to Qlik and I'm trying to build up my data model.&lt;/P&gt;&lt;P&gt;My data model is made mainly with slowly changing dimensions, which I have combined into one 'Sub intervals' table (Based on the partitioning solution in &lt;A href="https://community.qlik.com/docs/DOC-4310"&gt;IntervalMatch and Slowly Changing Dimensions&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically my end result is being able to choose a point in time, and see the state of my members based on the different slowly changing dimensions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was able to get this to work, however it was quite heavy and the solution affected performance even when I only had about 5% of the data load I'll have eventually...&lt;/P&gt;&lt;P&gt;I figured a big cause for this was the fact that I kept all my dates in a timestamp format of 'yyyy-MM-dd hh:mm:ss' meaning that had a lot of different entries on the calendar table for the same date ( which caused problems in normalizing and compacting the date).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I decided to split my periods from a column for "From_datetime" and a column for "To_datetime", to 4 columns:&lt;/P&gt;&lt;P&gt;[From_date],&lt;/P&gt;&lt;P&gt;[From_Time],&lt;/P&gt;&lt;P&gt;[To_date],&lt;/P&gt;&lt;P&gt;[To_Time]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However I'm stuck on the step where I do the interval match between my sub intervals and the original slowly changing dimensions:&lt;/P&gt;&lt;P&gt;This is the code I had which worked, before the separation of date and time. Note that EXTERNAL_ID is a unique persons ID which is linked to each period.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;// ============ Create the bridge table between the subintervals and the TRANS ============&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Tmp_TRANS_BridgeTable:&lt;/P&gt;&lt;P&gt;IntervalMatch (SubIntervalBegin, EXTERNAL_ID)&lt;/P&gt;&lt;P&gt;Load distinct FROM_DATE, TO_DATE, TmpEXTERNAL_ID as EXTERNAL_ID resident TRANS;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TRANS_BridgeTable:&lt;/P&gt;&lt;P&gt;Load &lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt;EXTERNAL_ID &amp;amp; '|' &amp;amp; FROM_DATE &amp;amp; '|' &amp;amp; TO_DATE as TRANS_ID,&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; EXTERNAL_ID &amp;amp; '|' &amp;amp; SubIntervalBegin as SubIntervalID&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Resident Tmp_TRANS_BridgeTable;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I now have separated the subintervals table to have instead of a [SubIntervalBegin] column, have 2 columns for:&lt;/P&gt;&lt;P&gt;[SubIntervalBeginDate], [SubIntervalBeginTime]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure how to update my script. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks beforehand &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jun 2015 07:14:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Interval-match-with-both-date-and-time/m-p/868044#M656457</guid>
      <dc:creator />
      <dc:date>2015-06-11T07:14:14Z</dc:date>
    </item>
  </channel>
</rss>

