<?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: Dynamic joins - how would you solve this ? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Dynamic-joins-how-would-you-solve-this/m-p/2000644#M1221373</link>
    <description>&lt;P&gt;cumulative:&lt;BR /&gt;count({&amp;lt;type={'Cumulative'}, Date={"&amp;lt;=$(maxDate)"}&amp;gt;}Name)&lt;BR /&gt;&lt;BR /&gt;the expression that counts exact birthdates:&lt;BR /&gt;=sum({&amp;lt;type={'Prior'}&amp;gt;}ExactDate)&lt;/P&gt;
&lt;P&gt;you need to set these:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="edwin_6-1667561838086.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/92935iED43B717490027BD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="edwin_6-1667561838086.png" alt="edwin_6-1667561838086.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 04 Nov 2022 11:37:25 GMT</pubDate>
    <dc:creator>edwin</dc:creator>
    <dc:date>2022-11-04T11:37:25Z</dc:date>
    <item>
      <title>Dynamic joins - how would you solve this ?</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-joins-how-would-you-solve-this/m-p/2000264#M1221358</link>
      <description>&lt;P&gt;I have 2 tables (see pictures below): Date, BirthDay that I'm combining to create the third one BirthDayCount using joins on the "Date" field in the script.&lt;BR /&gt;&lt;BR /&gt;I need the "CumulBday" column, the issue is, the table is generated at load time and is unaffected by the user selection. So when a user filter for "Bob" the&amp;nbsp;BirthDayCount table does not change and the&amp;nbsp;"CumulBday" column still contains all the values.&lt;BR /&gt;&lt;BR /&gt;Even if I were to include a variable in the script, the variable would only affect the table at load time, but would not refresh every time the user change the selection.&lt;BR /&gt;&lt;BR /&gt;Is there a way to handle the joins and build the table right into the "Sheet" section of the app ?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Derek_T_0-1667491107051.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/92836i5B70B870E5903206/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Derek_T_0-1667491107051.png" alt="Derek_T_0-1667491107051.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2022 15:59:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-joins-how-would-you-solve-this/m-p/2000264#M1221358</guid>
      <dc:creator>Derek_T</dc:creator>
      <dc:date>2022-11-03T15:59:29Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic joins - how would you solve this ?</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-joins-how-would-you-solve-this/m-p/2000629#M1221370</link>
      <description>&lt;P&gt;one way is to add a bridge between your birthdates and the calendar.&amp;nbsp; the idea is to create an association between the calendar and the birthdates when a name is selected only the dates you are interested in are selectable and it will be range and not just the exact equals.&amp;nbsp; for example, if your calendar starts from 2000 to 2022 and you select a name with birthdate = 1/1/2020 - all the dates from&amp;nbsp; 1/1/2020&amp;nbsp; to 2022 are selectable and therefore reportable.&amp;nbsp; the simplest part is cumulative.&amp;nbsp; since all the dates are associated, you simply count the names associated to each calendar date - this means your expression will be super fast.&amp;nbsp; what makes it complicated is now you want to report prior years where there are no birthdates yet, you then need a backward looking association.&amp;nbsp; y will then have two types of dates one that is for cumulative calculation that starts from the first birthdate selected going up to whatever date you want and a prior date that starts from the first date in your calendar going to your last birthdate.&amp;nbsp; heres my code:&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;SET ThousandSep=',';
SET DecimalSep='.';
SET MoneyThousandSep=',';
SET MoneyDecimalSep='.';
SET MoneyFormat='$#,##0.00;-$#,##0.00';
SET TimeFormat='h:mm:ss TT';
SET DateFormat='YYYY-MM-DD';
SET TimestampFormat='YYYY-MM-DD h:mm:ss[.fff] TT';
SET FirstWeekDay=6;
SET BrokenWeeks=1;
SET ReferenceDay=0;
SET FirstMonthOfYear=1;
SET CollationLocale='en-CA';
SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';
SET LongMonthNames='January;February;March;April;May;June;July;August;September;October;November;December';
SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';
SET LongDayNames='Monday;Tuesday;Wednesday;Thursday;Friday;Saturday;Sunday';


NoConcatenate
Births:
load * inline [
Name, BirthDate
bob, 2022-01-20
cindy, 2021-03-22
megan, 2021-03-24
megan2, 2021-03-24
];

NoConcatenate
Dates:
load date(today()-iterno()+1) as Date
while date(today()-iterno()+1)&amp;gt;=date('2021-01-01');
load 1 AutoGenerate(1);

NoConcatenate
tmpBirthdays:
load distinct BirthDate resident Births;

outer join (tmpBirthdays)
load Date resident Dates;

NoConcatenate
Birthdays:
load BirthDate, Date, if(BirthDate=Date,1,0) as ExactDate, 'Cumulative' as type resident tmpBirthdays
where Date&amp;gt;=BirthDate;

concatenate(Birthdays)
load BirthDate, Date, if(BirthDate=Date,1,0) as ExactDate, 'Prior' as type resident tmpBirthdays
where Date&amp;lt;=BirthDate;

drop table tmpBirthdays;&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 04 Nov 2022 11:22:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-joins-how-would-you-solve-this/m-p/2000629#M1221370</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2022-11-04T11:22:10Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic joins - how would you solve this ?</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-joins-how-would-you-solve-this/m-p/2000632#M1221371</link>
      <description>&lt;P&gt;this is how the DM looks like:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="edwin_0-1667561086346.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/92929i8FD90F64AB9F75B1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="edwin_0-1667561086346.png" alt="edwin_0-1667561086346.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2022 11:24:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-joins-how-would-you-solve-this/m-p/2000632#M1221371</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2022-11-04T11:24:55Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic joins - how would you solve this ?</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-joins-how-would-you-solve-this/m-p/2000642#M1221372</link>
      <description>&lt;P&gt;for the UI, i created a variable&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="edwin_1-1667561209880.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/92930iBBD612900577CF85/image-size/medium?v=v2&amp;amp;px=400" role="button" title="edwin_1-1667561209880.png" alt="edwin_1-1667561209880.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;i didnt want to display the whole calendar - only up to the last birthdate.&amp;nbsp; this is for cumulative:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="edwin_2-1667561334674.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/92931i6FD0A9956A82AAA3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="edwin_2-1667561334674.png" alt="edwin_2-1667561334674.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="edwin_3-1667561376748.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/92932i49F7ADDB9365FB85/image-size/medium?v=v2&amp;amp;px=400" role="button" title="edwin_3-1667561376748.png" alt="edwin_3-1667561376748.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;notice where it starts and ends - based on selected names.&lt;BR /&gt;&lt;BR /&gt;this includes teh start of the calendar and individual birthdates my calendars starts 1/1/2021:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="edwin_4-1667561517377.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/92933i51BA527E1A0749BF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="edwin_4-1667561517377.png" alt="edwin_4-1667561517377.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;this is the first birthdate:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="edwin_5-1667561662695.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/92934i9082FB858E190C7C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="edwin_5-1667561662695.png" alt="edwin_5-1667561662695.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2022 11:34:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-joins-how-would-you-solve-this/m-p/2000642#M1221372</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2022-11-04T11:34:36Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic joins - how would you solve this ?</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-joins-how-would-you-solve-this/m-p/2000644#M1221373</link>
      <description>&lt;P&gt;cumulative:&lt;BR /&gt;count({&amp;lt;type={'Cumulative'}, Date={"&amp;lt;=$(maxDate)"}&amp;gt;}Name)&lt;BR /&gt;&lt;BR /&gt;the expression that counts exact birthdates:&lt;BR /&gt;=sum({&amp;lt;type={'Prior'}&amp;gt;}ExactDate)&lt;/P&gt;
&lt;P&gt;you need to set these:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="edwin_6-1667561838086.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/92935iED43B717490027BD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="edwin_6-1667561838086.png" alt="edwin_6-1667561838086.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2022 11:37:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-joins-how-would-you-solve-this/m-p/2000644#M1221373</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2022-11-04T11:37:25Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic joins - how would you solve this ?</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-joins-how-would-you-solve-this/m-p/2000645#M1221374</link>
      <description>&lt;P&gt;this solution leverages the associative engine which is what you really are buying.&amp;nbsp; you can implement a complicated expression for sure&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2022 11:38:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-joins-how-would-you-solve-this/m-p/2000645#M1221374</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2022-11-04T11:38:42Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic joins - how would you solve this ?</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-joins-how-would-you-solve-this/m-p/2001380#M1221401</link>
      <description>&lt;P&gt;Thanks Edwin unfortunately it did not work for me. The info was available in another table I was able to get it without doing all of this.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2022 19:17:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-joins-how-would-you-solve-this/m-p/2001380#M1221401</guid>
      <dc:creator>Derek_T</dc:creator>
      <dc:date>2022-11-07T19:17:55Z</dc:date>
    </item>
  </channel>
</rss>

