<?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 Using two resident tables in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-two-resident-tables/m-p/250102#M1192168</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But, can I use this function in the same load script?&lt;/P&gt;&lt;P&gt;My Start Date and End Date are in one table, but the holidays are in other table. &lt;/P&gt;&lt;P&gt;My load is not working because the field holyday, ou nonworkingday is in other table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible to resolve it in the same load script?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Aug 2011 17:00:44 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-08-04T17:00:44Z</dc:date>
    <item>
      <title>Using two resident tables</title>
      <link>https://community.qlik.com/t5/QlikView/Using-two-resident-tables/m-p/250100#M1192166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Helo, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have one problem in using resident tables in my script. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The question is:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I have 2 tables (both residents):&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI&gt;The first with an Id, a start date and a end date.&lt;/LI&gt;&lt;LI&gt;The second with nonworking days (weekends and hollidays)&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I need to generate a third table, with the Id, the start date, the end date, the number of calendar days between the dates, and the number of working days between the dates. &lt;/LI&gt;&lt;LI&gt;The formula for the number of calendar days is: &lt;UL&gt;&lt;LI&gt;[End date] - [start date]. This I calculated directly in the script.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The formula for the number of workind days is: &lt;UL&gt;&lt;LI&gt;[End date] - [start date] - count(if([nonworking day] &amp;gt;= [start date] and [nonworking day] &amp;lt;= [end date], [nonworking day])).&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Somebody could show me how to create a script to create the third table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Aug 2011 15:15:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-two-resident-tables/m-p/250100#M1192166</guid>
      <dc:creator />
      <dc:date>2011-08-04T15:15:13Z</dc:date>
    </item>
    <item>
      <title>Re: Using two resident tables</title>
      <link>https://community.qlik.com/t5/QlikView/Using-two-resident-tables/m-p/250101#M1192167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;wanderson.ferro wrote:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;UL&gt;&lt;LI&gt;The formula for the number of workind days is: &lt;UL&gt;&lt;LI&gt;[End date] - [start date] - count(if([nonworking day] &amp;gt;= [start date] and [nonworking day] &amp;lt;= [end date], [nonworking day])).&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;H4 style="background-color: #c0c0c0;"&gt;networkdays&lt;A name="kanchor523"&gt;&lt;/A&gt;&lt;A name="networkdays"&gt;&lt;/A&gt; ( &lt;SPAN style="font-style: italic;"&gt;start:date, end_date {, holiday}&lt;/SPAN&gt; )&lt;/H4&gt;&lt;P&gt;Returns the number of working days (Monday-Friday) between and including &lt;SPAN style="font-style: italic;"&gt;start_date&lt;/SPAN&gt; and &lt;SPAN style="font-style: italic;"&gt;end_date&lt;/SPAN&gt; taking into account any optionally listed &lt;SPAN style="font-style: italic;"&gt;holidays&lt;/SPAN&gt;. All parameters should be valid dates or timestamps.&lt;/P&gt;&lt;H2&gt;Examples:&lt;/H2&gt;&lt;P&gt;&lt;SPAN class="Bold"&gt;networkdays&lt;/SPAN&gt; ('2007-02-19', '2007-03-01') returns 9&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Bold"&gt;networkdays&lt;/SPAN&gt; ('2006-12-18', '2006-12-31', '2006-12-25', '2006-12-26') returns 8&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See attachment&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Aug 2011 15:18:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-two-resident-tables/m-p/250101#M1192167</guid>
      <dc:creator />
      <dc:date>2011-08-04T15:18:36Z</dc:date>
    </item>
    <item>
      <title>Using two resident tables</title>
      <link>https://community.qlik.com/t5/QlikView/Using-two-resident-tables/m-p/250102#M1192168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But, can I use this function in the same load script?&lt;/P&gt;&lt;P&gt;My Start Date and End Date are in one table, but the holidays are in other table. &lt;/P&gt;&lt;P&gt;My load is not working because the field holyday, ou nonworkingday is in other table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible to resolve it in the same load script?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Aug 2011 17:00:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-two-resident-tables/m-p/250102#M1192168</guid>
      <dc:creator />
      <dc:date>2011-08-04T17:00:44Z</dc:date>
    </item>
    <item>
      <title>Using two resident tables</title>
      <link>https://community.qlik.com/t5/QlikView/Using-two-resident-tables/m-p/250103#M1192169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See the example provided by Nick. He builds the holiday list in a variable using concat(). The holidays can be in another table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Aug 2011 19:36:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-two-resident-tables/m-p/250103#M1192169</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2011-08-04T19:36:56Z</dc:date>
    </item>
    <item>
      <title>Using two resident tables</title>
      <link>https://community.qlik.com/t5/QlikView/Using-two-resident-tables/m-p/250104#M1192170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, the example provided by nick calculate de working days in an object (graphic).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to load the working days calculated like a field in the load script. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my example, my model would have just one table, with the dates (start and end) and the number of working days between them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looking the script, he just charge the data and after calculate the working days in the graphic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible to work with 2 tables in the load script?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Aug 2011 19:56:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-two-resident-tables/m-p/250104#M1192170</guid>
      <dc:creator />
      <dc:date>2011-08-04T19:56:33Z</dc:date>
    </item>
    <item>
      <title>Using two resident tables</title>
      <link>https://community.qlik.com/t5/QlikView/Using-two-resident-tables/m-p/250105#M1192171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've showed two approaches in my example to calculate working days. It's up to you which one you will implement in your script.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Aug 2011 23:26:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-two-resident-tables/m-p/250105#M1192171</guid>
      <dc:creator />
      <dc:date>2011-08-04T23:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: Using two resident tables</title>
      <link>https://community.qlik.com/t5/QlikView/Using-two-resident-tables/m-p/250106#M1192172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nick, thanks for your examples, but I think they don´t solve my problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You calculate the working days by 2 different ways:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - Using the function networkdays;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - Using a combination of the function sum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both ways are calculated in the CH01 object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN id="result_box" lang="en"&gt;&lt;SPAN class="hps"&gt;But, I need&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;the working days&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;are already&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;calculated&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;at the end of&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;data load.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="en"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;&lt;SPAN class="hps"&gt;In your&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;examples&lt;/SPAN&gt;&lt;SPAN&gt;, the calculation&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;occurs dynamically&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;in the object(CH01).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;&lt;SPAN class="hps"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;&lt;SPAN class="hps"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;&lt;SPAN class="hps"&gt;&lt;SPAN id="result_box" lang="en"&gt;&lt;SPAN class="hps"&gt;If your examples have resolved the issue, I apologize. I could not able to find the solution.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="en"&gt;&lt;SPAN class="hps"&gt;&lt;SPAN lang="en"&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="hps"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2011 11:41:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-two-resident-tables/m-p/250106#M1192172</guid>
      <dc:creator />
      <dc:date>2011-08-05T11:41:31Z</dc:date>
    </item>
    <item>
      <title>Re: Using two resident tables</title>
      <link>https://community.qlik.com/t5/QlikView/Using-two-resident-tables/m-p/250107#M1192173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's easy. All what you need is just to convert expressions from the chart &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;sum(DayCount)&lt;/P&gt;&lt;P&gt;sum(DayCount) - sum({&amp;lt;HolydayFlag={1}&amp;gt;} DayCount)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to a script at the end of my existing example script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;Left Join (DateRangeCalendar)&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dmDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; HolydayFlag,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DayCount&lt;/P&gt;&lt;P&gt;Resident Calendar;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left Join (DateRange)&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; StartDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; EndDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CalendarDays,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Holydays,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CalendarDays - Holydays as WorkDays&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; StartDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; EndDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(DayCount) as CalendarDays,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(HolydayFlag) as Holydays&lt;/P&gt;&lt;P&gt;Resident DateRangeCalendar&lt;/P&gt;&lt;P&gt;Group by StartDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; EndDate;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP Tables DateRangeCalendar, Calendar;&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2011 13:32:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-two-resident-tables/m-p/250107#M1192173</guid>
      <dc:creator />
      <dc:date>2011-08-05T13:32:27Z</dc:date>
    </item>
    <item>
      <title>Re: Using two resident tables</title>
      <link>https://community.qlik.com/t5/QlikView/Using-two-resident-tables/m-p/250108#M1192174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nick, thanks a lot!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was not able to find this way to write the script by myself.&lt;/P&gt;&lt;P&gt;I´m just starting to work with QlikView.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2011 13:40:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-two-resident-tables/m-p/250108#M1192174</guid>
      <dc:creator />
      <dc:date>2011-08-05T13:40:59Z</dc:date>
    </item>
  </channel>
</rss>

