<?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 Average Period -&amp;gt; Working days in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Average-Period-gt-Working-days/m-p/207338#M63131</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all !&lt;BR /&gt;&lt;BR /&gt;I'm again sorry for the bad english : I'm french ^^&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I have to calculate the average period between bug's creation and bug's resolvation. For the moment, I calculate this period with week-end. But i have to calculate this only with working days (without Saturday, Sunday, and public holiday).&lt;BR /&gt;&lt;BR /&gt;For each bug, I have its creation date, and its resolvation date (if this bug is "Resolved").&lt;BR /&gt;&lt;BR /&gt;I had this expression : AVG({&amp;lt;Etat={"Resolved"}&amp;gt;} [Resol_date] - [Create_date])&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I have access to a calendar (ID_DATE, ID_WEEK, ID_MONTH, YEAR, DAY_TYPE) where DAY_TYPE can be "Work_day", or "Week_end" or "Pub_holiday". And to a table with columns : ID_DATE, ID_BUG, State where State can be "New", or "Resolved".&lt;BR /&gt;&lt;BR /&gt;I want my period is calculated for each bug which are "Resolved" for today, for the selected date, and for the selected period (weeks, months, and year) by knowing that bug's states for a period are states the last day of this period.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I tested :&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;=avg({&amp;lt;State={"Resolved"}&amp;gt;} ([Resol_date] - [Create_date] ))&lt;BR /&gt;- count({1 + &amp;lt;State={"Resolved"}&amp;gt;} IF(ID_DATE&amp;gt;=date([Create_date]) AND ID_DATE&amp;lt;=date([Resol_date]) AND DAY_TYPE&amp;lt;&amp;gt;'Work_day' , ID_DATE))&lt;BR /&gt;/ count({&amp;lt;State={"Resolved"}&amp;gt;} DISTINCT ID_Bug)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;- AVG returns the resolvation average period (with week ends, public holidays, ...)&lt;BR /&gt;- 1st count must return number of days on week-end or public holiday for all bugs between their creation date and their resolvation date&lt;BR /&gt;- 2nd count return number of bugs "Resolved" (according to acivre selection). &lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;The first count returns bad results ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for help me ! If you had any questions, I'm here.&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Pierre C.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 10 Apr 2011 18:55:03 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-04-10T18:55:03Z</dc:date>
    <item>
      <title>Average Period -&gt; Working days</title>
      <link>https://community.qlik.com/t5/QlikView/Average-Period-gt-Working-days/m-p/207338#M63131</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all !&lt;BR /&gt;&lt;BR /&gt;I'm again sorry for the bad english : I'm french ^^&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I have to calculate the average period between bug's creation and bug's resolvation. For the moment, I calculate this period with week-end. But i have to calculate this only with working days (without Saturday, Sunday, and public holiday).&lt;BR /&gt;&lt;BR /&gt;For each bug, I have its creation date, and its resolvation date (if this bug is "Resolved").&lt;BR /&gt;&lt;BR /&gt;I had this expression : AVG({&amp;lt;Etat={"Resolved"}&amp;gt;} [Resol_date] - [Create_date])&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I have access to a calendar (ID_DATE, ID_WEEK, ID_MONTH, YEAR, DAY_TYPE) where DAY_TYPE can be "Work_day", or "Week_end" or "Pub_holiday". And to a table with columns : ID_DATE, ID_BUG, State where State can be "New", or "Resolved".&lt;BR /&gt;&lt;BR /&gt;I want my period is calculated for each bug which are "Resolved" for today, for the selected date, and for the selected period (weeks, months, and year) by knowing that bug's states for a period are states the last day of this period.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I tested :&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;=avg({&amp;lt;State={"Resolved"}&amp;gt;} ([Resol_date] - [Create_date] ))&lt;BR /&gt;- count({1 + &amp;lt;State={"Resolved"}&amp;gt;} IF(ID_DATE&amp;gt;=date([Create_date]) AND ID_DATE&amp;lt;=date([Resol_date]) AND DAY_TYPE&amp;lt;&amp;gt;'Work_day' , ID_DATE))&lt;BR /&gt;/ count({&amp;lt;State={"Resolved"}&amp;gt;} DISTINCT ID_Bug)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;- AVG returns the resolvation average period (with week ends, public holidays, ...)&lt;BR /&gt;- 1st count must return number of days on week-end or public holiday for all bugs between their creation date and their resolvation date&lt;BR /&gt;- 2nd count return number of bugs "Resolved" (according to acivre selection). &lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;The first count returns bad results ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for help me ! If you had any questions, I'm here.&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Pierre C.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 10 Apr 2011 18:55:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-Period-gt-Working-days/m-p/207338#M63131</guid>
      <dc:creator />
      <dc:date>2011-04-10T18:55:03Z</dc:date>
    </item>
    <item>
      <title>Average Period -&gt; Working days</title>
      <link>https://community.qlik.com/t5/QlikView/Average-Period-gt-Working-days/m-p/207339#M63132</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have a look at NETWORKDAYS() function. this might be helpful for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, tresesco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 10 Apr 2011 19:56:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-Period-gt-Working-days/m-p/207339#M63132</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2011-04-10T19:56:27Z</dc:date>
    </item>
    <item>
      <title>AW:Average Period -&gt; Working days</title>
      <link>https://community.qlik.com/t5/QlikView/Average-Period-gt-Working-days/m-p/207340#M63133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Pierre,&lt;/P&gt;&lt;P&gt;I can see in the first count that you mix up SET Analysis and an IF()-clause. This is possible but if you think this is your misleading expression I wouldn't mix it. What about counting with an IF() similar to this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;count( IF( State="Resolved" AND ID_DATE&amp;gt;=date([Create_date]) AND ID_DATE&amp;lt;=date([Resol_dat .....&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;HtH&lt;/P&gt;&lt;P&gt;Roland&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 10 Apr 2011 20:51:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-Period-gt-Working-days/m-p/207340#M63133</guid>
      <dc:creator />
      <dc:date>2011-04-10T20:51:57Z</dc:date>
    </item>
    <item>
      <title>Average Period -&gt; Working days</title>
      <link>https://community.qlik.com/t5/QlikView/Average-Period-gt-Working-days/m-p/207341#M63134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi !&lt;/P&gt;&lt;P&gt;Thanks a lot for your help tresesco and Roland.&lt;/P&gt;&lt;P&gt;I think i already tested the IF()-clause you propose to me.&lt;BR /&gt;But I tested the NetWorkDays() function (which I didn't know) and results are good &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;&lt;/P&gt;&lt;P&gt;--&amp;gt; =&lt;B&gt;AVG&lt;/B&gt;({&amp;lt;State={&lt;B&gt;"Resolved"&lt;/B&gt;}&amp;gt;} &lt;B&gt;NETWORKDAYS&lt;/B&gt;(&lt;B&gt;[Create_date]&lt;/B&gt;, &lt;B&gt;[Resol_date]&lt;/B&gt;)-1)&lt;/P&gt;&lt;P&gt;Thank you for your quick help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Apr 2011 09:06:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-Period-gt-Working-days/m-p/207341#M63134</guid>
      <dc:creator />
      <dc:date>2011-04-11T09:06:59Z</dc:date>
    </item>
  </channel>
</rss>

