<?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 Re: issue with canonical date implementation in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/issue-with-canonical-date-implementation/m-p/2070371#M87783</link>
    <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/133620"&gt;@ioannaiogr&lt;/a&gt;&amp;nbsp; I think in your previous post also I had mentioned the approach but not sure did you try it but again I am posting this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Applications_Fact1:
Load ApplicationID,
ApplicationIssueDate,
ApplicationSubmittedDate,
ApplicantID
FROM Source;

Left Join(Applications_Fact1)
LOAD ApplicantID,
     ApplicantInsertedDate
FROM Source;

Applications_Fact:
load *,
     Floor(ApplicationIssueDate)&amp;amp;'|'&amp;amp;Floor(ApplicationSubmittedDate)&amp;amp;'|'&amp;amp;Floor(ApplicantInsertedDate) as Key
Resident Applications_Fact1;

Drop Table Applications_Fact1;

date_bridge:
Load Key,
     date(SubField(Key,'|',1)) as CanonicalDate,
     'IssueDate' as DateType;
Load FieldValue('Key',RecNo()) as Key
AutoGenerate FieldValueCount('Key');

Concatenate(date_bridge)
Load Key,
     date(SubField(Key,'|',2)) as CanonicalDate,
     'SubmittedDate' as DateType;
Load FieldValue('Key',RecNo()) as Key
AutoGenerate FieldValueCount('Key');

Concatenate(date_bridge)
Load Key,
     date(SubField(Key,'|',3)) as CanonicalDate,
     'InsertedDate' as DateType;
Load FieldValue('Key',RecNo()) as Key
AutoGenerate FieldValueCount('Key');

autonumber Key;
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 11 May 2023 20:48:22 GMT</pubDate>
    <dc:creator>Kushal_Chawda</dc:creator>
    <dc:date>2023-05-11T20:48:22Z</dc:date>
    <item>
      <title>issue with canonical date implementation</title>
      <link>https://community.qlik.com/t5/App-Development/issue-with-canonical-date-implementation/m-p/2070321#M87780</link>
      <description>&lt;P&gt;Hello all. I'm pretty sure I'm implementing my date bridge incorrectly.&lt;/P&gt;
&lt;P&gt;I studied again this post by HIC&amp;nbsp;&lt;A href="https://community.qlik.com/t5/Design/Canonical-Date/ba-p/1463578" target="_self"&gt;CanonicalDate&lt;/A&gt;&amp;nbsp; .&lt;/P&gt;
&lt;P&gt;I have two tables&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Applications_Fact&lt;/STRONG&gt;:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Load ApplicationID,&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;ApplicationIssueDate,&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;ApplicationSubmittedDate&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;ApplicantID;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Applicants_Dimension&lt;/STRONG&gt;:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;ApplicantID,&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;ApplicantInsertedDate;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One applicantID can have many applicationIDs. I've looked into it and If I understood correctly, my fine enough grain table is my fact table because one application id has one value of each date associated.&lt;/P&gt;
&lt;P&gt;Imagine that my data in fact table are like&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;ApplicantID&amp;nbsp; &amp;nbsp; ApplicationID&amp;nbsp; ApplicationIssueDate&amp;nbsp; &amp;nbsp;ApplicationSubmittedDate&amp;nbsp; &amp;nbsp;ApplicantDateInserted&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 11/5/2023&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 11/5/2023&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10/5/2023&lt;/P&gt;
&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 12/5/2023&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;11/5/2023&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10/5/2023&lt;/P&gt;
&lt;P&gt;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 100&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;9/5/2023&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;8/5/2023&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;7/5/2023&lt;/P&gt;
&lt;P&gt;In between note: The thing is, that there are applicantID from the dimension table that got inserted in the academicYear (which i have in my canonical calendar which i'll show later), so they have an&amp;nbsp; ApplicantinsertionDate&amp;nbsp; BUT they don't have an applicationID in the fact table... So these get ignored. I'm missing these completely. Even if I joined, with the date bridge for applicationID they get LOST and ignored.&lt;/P&gt;
&lt;P&gt;Anyway, I did a mapping table as suggested for my Dimension table like:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;MapTable:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;MAPPING LOAD &lt;EM&gt;ApplicantID, ApplicantDateInserted resident Applicants_Dimension&lt;/EM&gt;;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and a &lt;STRONG&gt;date bridge&lt;/STRONG&gt; as counseled:&lt;/P&gt;
&lt;P&gt;Load &lt;EM&gt;ApplicationID,&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;ApplyMap('MapTable',ApplicantID,null()) as CanonicalDate,&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; 'Applicant_inserted' as DateType&lt;/EM&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;resident Applications_Facts;&lt;/P&gt;
&lt;P&gt;Load &lt;EM&gt;ApplicationID,&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ApplicationSubmittedDate as CanonicalDate,&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'Submitted' as DateType&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;resident&amp;nbsp; Applications_Facts;&lt;/P&gt;
&lt;P&gt;Load &lt;EM&gt;ApplicationID,&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ApplicationIssueDate as CanonicalDate,&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'Issued' as DateType&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;resident&amp;nbsp; Applications_Facts;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And then linked the CanonicalDate to the CanonicalCalendar. The measures work perfectly for Applications cause I've cross-checked though SQL queries. My issue is the applicants with no applications that go missing... I'm sure it's the date bridge. I pick AcademicYear in CanonicalCalendar and where there is no application in this year, the applicant- POOF- disappears. But If I just pick date range in my ApplicantDateInserted field, the count is as it should be... But i want it to work with DateType='ApplicantDateInserted'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope i'm getting some feedback... I want to know what is my issue.&lt;/P&gt;
&lt;P&gt;Sorry for the gigantic post. I was trying to be explaining. Also ,sorry, as this is my 3rd post for this canonical date, but now I'm sure this is the problem.&lt;/P&gt;
&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Thu, 11 May 2023 16:45:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/issue-with-canonical-date-implementation/m-p/2070321#M87780</guid>
      <dc:creator>ioannaiogr</dc:creator>
      <dc:date>2023-05-11T16:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: issue with canonical date implementation</title>
      <link>https://community.qlik.com/t5/App-Development/issue-with-canonical-date-implementation/m-p/2070371#M87783</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/133620"&gt;@ioannaiogr&lt;/a&gt;&amp;nbsp; I think in your previous post also I had mentioned the approach but not sure did you try it but again I am posting this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Applications_Fact1:
Load ApplicationID,
ApplicationIssueDate,
ApplicationSubmittedDate,
ApplicantID
FROM Source;

Left Join(Applications_Fact1)
LOAD ApplicantID,
     ApplicantInsertedDate
FROM Source;

Applications_Fact:
load *,
     Floor(ApplicationIssueDate)&amp;amp;'|'&amp;amp;Floor(ApplicationSubmittedDate)&amp;amp;'|'&amp;amp;Floor(ApplicantInsertedDate) as Key
Resident Applications_Fact1;

Drop Table Applications_Fact1;

date_bridge:
Load Key,
     date(SubField(Key,'|',1)) as CanonicalDate,
     'IssueDate' as DateType;
Load FieldValue('Key',RecNo()) as Key
AutoGenerate FieldValueCount('Key');

Concatenate(date_bridge)
Load Key,
     date(SubField(Key,'|',2)) as CanonicalDate,
     'SubmittedDate' as DateType;
Load FieldValue('Key',RecNo()) as Key
AutoGenerate FieldValueCount('Key');

Concatenate(date_bridge)
Load Key,
     date(SubField(Key,'|',3)) as CanonicalDate,
     'InsertedDate' as DateType;
Load FieldValue('Key',RecNo()) as Key
AutoGenerate FieldValueCount('Key');

autonumber Key;
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 May 2023 20:48:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/issue-with-canonical-date-implementation/m-p/2070371#M87783</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2023-05-11T20:48:22Z</dc:date>
    </item>
    <item>
      <title>Re: issue with canonical date implementation</title>
      <link>https://community.qlik.com/t5/App-Development/issue-with-canonical-date-implementation/m-p/2070379#M87785</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/336"&gt;@Kushal_Chawda&lt;/a&gt;&amp;nbsp;, with left join, aren't I missing those applicants without applications?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 May 2023 20:34:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/issue-with-canonical-date-implementation/m-p/2070379#M87785</guid>
      <dc:creator>ioannaiogr</dc:creator>
      <dc:date>2023-05-11T20:34:28Z</dc:date>
    </item>
    <item>
      <title>Re: issue with canonical date implementation</title>
      <link>https://community.qlik.com/t5/App-Development/issue-with-canonical-date-implementation/m-p/2070382#M87786</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/133620"&gt;@ioannaiogr&lt;/a&gt;&amp;nbsp; you can change the join type depending on your requirement. So instead you can just use "Join"&lt;/P&gt;</description>
      <pubDate>Thu, 11 May 2023 20:45:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/issue-with-canonical-date-implementation/m-p/2070382#M87786</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2023-05-11T20:45:02Z</dc:date>
    </item>
    <item>
      <title>Re: issue with canonical date implementation</title>
      <link>https://community.qlik.com/t5/App-Development/issue-with-canonical-date-implementation/m-p/2070574#M87803</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/336"&gt;@Kushal_Chawda&lt;/a&gt;&amp;nbsp;wait, what?! What just happened!? My problem is solved thanks to you&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I only have one question for this script. Why doesn't it work if in the initial Applications_Facts1 I also load the Key field and it needs a resident load and a drop later? What does that help?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 May 2023 09:45:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/issue-with-canonical-date-implementation/m-p/2070574#M87803</guid>
      <dc:creator>ioannaiogr</dc:creator>
      <dc:date>2023-05-12T09:45:16Z</dc:date>
    </item>
    <item>
      <title>Re: issue with canonical date implementation</title>
      <link>https://community.qlik.com/t5/App-Development/issue-with-canonical-date-implementation/m-p/2070580#M87804</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/133620"&gt;@ioannaiogr&lt;/a&gt;&amp;nbsp; I thought you have two different table that's why I used join to combine all dates into single table and on resident load created Key using those dates. But, if you already have all dates in one table no need to do the join and resident load.&lt;/P&gt;</description>
      <pubDate>Fri, 12 May 2023 10:12:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/issue-with-canonical-date-implementation/m-p/2070580#M87804</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2023-05-12T10:12:20Z</dc:date>
    </item>
    <item>
      <title>Re: issue with canonical date implementation</title>
      <link>https://community.qlik.com/t5/App-Development/issue-with-canonical-date-implementation/m-p/2070582#M87805</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/336"&gt;@Kushal_Chawda&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;No, i have them in 2 tables as you said. With join I have both in a table, but why did you have to resident load the firts then drop it?&lt;/P&gt;
&lt;P&gt;Couldn't I do like:&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Applications_Fact1:
Load ApplicationID,
ApplicationIssueDate,
ApplicationSubmittedDate,
ApplicantID
Floor(ApplicationIssueDate)&amp;amp;'|'&amp;amp;Floor(ApplicationSubmittedDate)&amp;amp;'|'&amp;amp;Floor(ApplicantInsertedDate) as Key
FROM Source;
Left Join(Applications_Fact1)
LOAD ApplicantID,
     ApplicantInsertedDate
FROM Source;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;and then connect by Key the CanonicalCalendar and the DateBridge&amp;nbsp; as you suggested?&lt;/P&gt;
&lt;P&gt;I know it doesn't work like that because I tried it before, but my question is why!&lt;span class="lia-unicode-emoji" title=":thinking_face:"&gt;🤔&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 May 2023 10:20:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/issue-with-canonical-date-implementation/m-p/2070582#M87805</guid>
      <dc:creator>ioannaiogr</dc:creator>
      <dc:date>2023-05-12T10:20:54Z</dc:date>
    </item>
    <item>
      <title>Re: issue with canonical date implementation</title>
      <link>https://community.qlik.com/t5/App-Development/issue-with-canonical-date-implementation/m-p/2070584#M87807</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/133620"&gt;@ioannaiogr&lt;/a&gt;&amp;nbsp; because after joining both the tables, resultant table contains all the required fields from both tables combining it to single table, so during joining process we can't refer to the columns which is getting joined in the same load. Hence, we need to take resident load to create a key using 3 date fields referring to previously joined table.&lt;/P&gt;</description>
      <pubDate>Fri, 12 May 2023 10:26:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/issue-with-canonical-date-implementation/m-p/2070584#M87807</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2023-05-12T10:26:44Z</dc:date>
    </item>
    <item>
      <title>Re: issue with canonical date implementation</title>
      <link>https://community.qlik.com/t5/App-Development/issue-with-canonical-date-implementation/m-p/2070586#M87809</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/336"&gt;@Kushal_Chawda&lt;/a&gt;&amp;nbsp;I see. I'll process it and If I have more questions I'll get back to you. Thank you so much!&lt;/P&gt;</description>
      <pubDate>Fri, 12 May 2023 10:37:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/issue-with-canonical-date-implementation/m-p/2070586#M87809</guid>
      <dc:creator>ioannaiogr</dc:creator>
      <dc:date>2023-05-12T10:37:07Z</dc:date>
    </item>
  </channel>
</rss>

