<?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: Formula simplification in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Formula-simplification/m-p/524967#M196132</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How about:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NetWorkDays(YearStart(Today()), Today())&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS: replace Today() with reload time or variable as required&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Nov 2013 11:50:47 GMT</pubDate>
    <dc:creator>jonathandienst</dc:creator>
    <dc:date>2013-11-14T11:50:47Z</dc:date>
    <item>
      <title>Formula simplification</title>
      <link>https://community.qlik.com/t5/QlikView/Formula-simplification/m-p/524966#M196131</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had two rather complex formulas for the calculation of workdays_so_far_this_year (Mo-Fri) and days_so_far_this_year (Mo-Sun).&lt;/P&gt;&lt;P&gt;They were&lt;/P&gt;&lt;P&gt;- &lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;SUM&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({1&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;%Datum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"&amp;gt;=$(=makedate(year(today()), 1, 1))&amp;lt;$(=DATE(v_today_num))"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; }&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Werktag&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)&amp;nbsp; [for workdays]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; (where &amp;gt;Werktag&amp;lt; is a binary field - 1 for (Mo-Fri), 0 for (Sat-Sun)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;- &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;COUNT&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({1&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;%Datum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"&amp;gt;=$(=makedate(year(today()), 1, 1))&amp;lt;$(=DATE(v_today_num))"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; }&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Werktag&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)&amp;nbsp; [for days]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Someone (sorry, it was offhand, so I didn't remember clearly) told me here on the forum how I could calculate the workdays_YTD much easier:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;=&amp;gt; floor(reloadtime()) - yearstart(reloadtime()) - that works fine because the app is reloaded daily.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;=&amp;gt; Is there also a way I can simplify the other formula, too? I'm sure that would result in a performance win, however small, as these formulas are present in every one of my apps.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Thanks a lot!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Best regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;DataNibbler&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.S.: Ceterum censeo - there should be, among others, a category for posts rgd. variables to make those easier discernable.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Nov 2013 11:46:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formula-simplification/m-p/524966#M196131</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2013-11-14T11:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: Formula simplification</title>
      <link>https://community.qlik.com/t5/QlikView/Formula-simplification/m-p/524967#M196132</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How about:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NetWorkDays(YearStart(Today()), Today())&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS: replace Today() with reload time or variable as required&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Nov 2013 11:50:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formula-simplification/m-p/524967#M196132</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2013-11-14T11:50:47Z</dc:date>
    </item>
    <item>
      <title>Re: Formula simplification</title>
      <link>https://community.qlik.com/t5/QlikView/Formula-simplification/m-p/524968#M196133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jonathan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;bull's_eye &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; That's going to work.&lt;/P&gt;&lt;P&gt;I will put those two variables in a qvs file - they are needed in every app...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Nov 2013 11:55:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formula-simplification/m-p/524968#M196133</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2013-11-14T11:55:02Z</dc:date>
    </item>
  </channel>
</rss>

