<?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: Where Condition in Load Statement in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Where-Condition-in-Load-Statement/m-p/100164#M15967</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;you can't divide by 26, but by the exact number of weeks for each resource&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum(hours) / ( today() - min([WorkDt_Date]) * 7&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Jul 2018 09:37:59 GMT</pubDate>
    <dc:creator>ogautier62</dc:creator>
    <dc:date>2018-07-02T09:37:59Z</dc:date>
    <item>
      <title>Where Condition in Load Statement</title>
      <link>https://community.qlik.com/t5/QlikView/Where-Condition-in-Load-Statement/m-p/100162#M15965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a load script in which i'm calculating the average hours over last 26 weeks (~6 months).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Resource_CUID] as [tResource_CUID],&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Key&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (Sum([Hours]) / 26) As [tHours]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RESIDENT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TimeTracking&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [WorkDt_Date] &amp;gt;= (Today() - (26*7))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; GROUP BY&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Resource_CUID]&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a column for Project Completion Date in my data model.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My requirement is to calculate the average hours for the last 26 weeks but when a project which has started after 26 weeks , the average should be calculated for that period only.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;26 weeks into past is January 2018.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, for example, if a project has started in May 2018, then it's average should be calculated from May and June (8 weeks only) and not over the entire 26-week window.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For a project that started in March, the avergae should bve calculated for March, April, May, June (16 weeks only) and not over 26-weeks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not able to get orrect syntax for where clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope I have made the requirement clear.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any Help would be appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Jul 2018 08:54:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Where-Condition-in-Load-Statement/m-p/100162#M15965</guid>
      <dc:creator>yashcena</dc:creator>
      <dc:date>2018-07-02T08:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: Where Condition in Load Statement</title>
      <link>https://community.qlik.com/t5/QlikView/Where-Condition-in-Load-Statement/m-p/100163#M15966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The script looks fine, but if the format of WorkDt_Date is not numeric in the format of (Today() - 26*7), which will be a numeric value like 43097 (and not DD/MM/YYYY or similar).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Jul 2018 09:03:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Where-Condition-in-Load-Statement/m-p/100163#M15966</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2018-07-02T09:03:22Z</dc:date>
    </item>
    <item>
      <title>Re: Where Condition in Load Statement</title>
      <link>https://community.qlik.com/t5/QlikView/Where-Condition-in-Load-Statement/m-p/100164#M15967</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;you can't divide by 26, but by the exact number of weeks for each resource&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum(hours) / ( today() - min([WorkDt_Date]) * 7&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Jul 2018 09:37:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Where-Condition-in-Load-Statement/m-p/100164#M15967</guid>
      <dc:creator>ogautier62</dc:creator>
      <dc:date>2018-07-02T09:37:59Z</dc:date>
    </item>
  </channel>
</rss>

