<?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: inweek with offset date in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/inweek-with-offset-date/m-p/531978#M691988</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;It seems that braсkets are missed in the last line: &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Num&lt;STRONG&gt;(&lt;/STRONG&gt;WeekStartDay&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Aug 2013 07:41:49 GMT</pubDate>
    <dc:creator>whiteline</dc:creator>
    <dc:date>2013-08-27T07:41:49Z</dc:date>
    <item>
      <title>inweek with offset date</title>
      <link>https://community.qlik.com/t5/QlikView/inweek-with-offset-date/m-p/531977#M691987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a set of data with 2 tables, one with IDs, starting days of the week and another with dates. I need to find the number of unique dates that are in the week starting with the day of a week for each ID. For instance, if one ID has a WeekStartDay of Monday, I want the weeks to be from Monday to Sunday. If another IDs WeekStartDay is Wednesday I want the weeks to be Wednesday to Tuesday. If a date occurs twice in the list I want to count only one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was trying something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load distinct&lt;/P&gt;&lt;P&gt;ID,&lt;/P&gt;&lt;P&gt;WeekStartDay,&lt;/P&gt;&lt;P&gt;Date,&lt;/P&gt;&lt;P&gt;WeekStart(Date, 0,Num(WeekStartDay) AS WeekStart,&amp;nbsp;&amp;nbsp; // Weekstart using offset of weekday&lt;/P&gt;&lt;P&gt;Count(Distinct&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Inweek( Date,&amp;nbsp;&amp;nbsp; WeekStart(Date,0,Num(WeekStartDay)&amp;nbsp;&amp;nbsp; )&amp;nbsp; ) AS DaysInWeek&amp;nbsp; // count the number in the week.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Group by ID, WeekStart(Date,0, NumWeekStartDay)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No matter what I try I get an invalid expression. Am I on the right track or is there a better way? Sample data is attached.&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;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Aug 2013 18:59:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/inweek-with-offset-date/m-p/531977#M691987</guid>
      <dc:creator />
      <dc:date>2013-08-26T18:59:07Z</dc:date>
    </item>
    <item>
      <title>Re: inweek with offset date</title>
      <link>https://community.qlik.com/t5/QlikView/inweek-with-offset-date/m-p/531978#M691988</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;It seems that braсkets are missed in the last line: &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Num&lt;STRONG&gt;(&lt;/STRONG&gt;WeekStartDay&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2013 07:41:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/inweek-with-offset-date/m-p/531978#M691988</guid>
      <dc:creator>whiteline</dc:creator>
      <dc:date>2013-08-27T07:41:49Z</dc:date>
    </item>
  </channel>
</rss>

