<?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: Using begin and end dates to define a calendar period field in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Using-begin-and-end-dates-to-define-a-calendar-period-field/m-p/132061#M9302</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Nicole, that worked!&amp;nbsp; I'm glad I asked!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 27 Jul 2018 20:48:18 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-07-27T20:48:18Z</dc:date>
    <item>
      <title>Using begin and end dates to define a calendar period field</title>
      <link>https://community.qlik.com/t5/App-Development/Using-begin-and-end-dates-to-define-a-calendar-period-field/m-p/132059#M9300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I am new to Qlik Sense, so I suspect there is an easy way to do this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have two tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ApInv2 - which shows the accounts payable invoice detail lines&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-image image-1" height="231" src="https://community.qlik.com/legacyfs/online/209015_pastedImage_0.png" style="width: 753.79px; height: 231px;" width="754" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And a second table called AcctPer, which shows the irregular sized accounting calendar periods (cal-period) that are used.&amp;nbsp; The Start-date and End-date fields define the size of each period and are in Julian format (which Qlik is able to interpret and convert to a regular date).&amp;nbsp; The calendar periods are in various sizes (4-5 weeks each) and sometimes span two different months (ie July 1 through Aug 4th).&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/209016_pastedImage_2.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to be able to create a bar chart using cal-period and have the Inv-date grouped in the appropriate cal-period to give me the AP invoice Amt for each cal-period.&lt;/P&gt;&lt;P&gt;Not sure how to go about this.&amp;nbsp; I am assuming I will be using the Start-date and End-date to determine which Cal-period each Inv-date belongs to.&amp;nbsp; Will I be using some form of Set Analysis to create a new calculated field on the ApInv2 table?&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-image image-3" height="185" src="https://community.qlik.com/legacyfs/online/209017_pastedImage_3.png" style="width: 744.805px; height: 185px;" width="745" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jul 2018 21:11:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-begin-and-end-dates-to-define-a-calendar-period-field/m-p/132059#M9300</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-07-26T21:11:08Z</dc:date>
    </item>
    <item>
      <title>Re: Using begin and end dates to define a calendar period field</title>
      <link>https://community.qlik.com/t5/App-Development/Using-begin-and-end-dates-to-define-a-calendar-period-field/m-p/132060#M9301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You'll want to use IntervalMatch() in your load script so the tables are linked properly: &lt;A href="https://help.qlik.com/en-US/sense/June2018/Subsystems/Hub/Content/Scripting/ScriptPrefixes/IntervalMatch.htm" title="https://help.qlik.com/en-US/sense/June2018/Subsystems/Hub/Content/Scripting/ScriptPrefixes/IntervalMatch.htm"&gt;https://help.qlik.com/en-US/sense/June2018/Subsystems/Hub/Content/Scripting/ScriptPrefixes/IntervalMatch.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code you will need will look something like this:&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_1532641182413210" jivemacro_uid="_1532641182413210"&gt;
&lt;P&gt;ApInv2:&lt;/P&gt;
&lt;P&gt;LOAD [Inv-doc-id],&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Inv-date],&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Vendor,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Item,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Line-no],&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Unit-price],&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Qty]&lt;/P&gt;
&lt;P&gt;FROM YourSource;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;AcctPer:&lt;/P&gt;
&lt;P&gt;LOAD [Cal-period],&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Start-date],&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [End-date]&lt;/P&gt;
&lt;P&gt;FROM YourSource;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;INNER JOIN (AcctPer)&lt;/P&gt;
&lt;P&gt;IntervalMatch ([Inv-date])&lt;/P&gt;
&lt;P&gt;LOAD [Start-date],&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [End-date]&lt;/P&gt;
&lt;P&gt;Resident AcctPer;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you'll be able to use [Cal-period] as the dimension on your bar chart because it will be linked properly on the back-end.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jul 2018 21:40:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-begin-and-end-dates-to-define-a-calendar-period-field/m-p/132060#M9301</guid>
      <dc:creator>Nicole-Smith</dc:creator>
      <dc:date>2018-07-26T21:40:15Z</dc:date>
    </item>
    <item>
      <title>Re: Using begin and end dates to define a calendar period field</title>
      <link>https://community.qlik.com/t5/App-Development/Using-begin-and-end-dates-to-define-a-calendar-period-field/m-p/132061#M9302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Nicole, that worked!&amp;nbsp; I'm glad I asked!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jul 2018 20:48:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-begin-and-end-dates-to-define-a-calendar-period-field/m-p/132061#M9302</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-07-27T20:48:18Z</dc:date>
    </item>
  </channel>
</rss>

