<?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: Week to date comparison in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Week-to-date-comparison/m-p/1744999#M57162</link>
    <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/126233"&gt;@MattOtoole&lt;/a&gt;&amp;nbsp; &amp;nbsp;There are couple of ways you can do it. Below way is to create the Flags in script. Last parameter in function&amp;nbsp;InWeekToDate is 0 which means first day of the week is Monday(0) . You can change it according to your requirement&lt;/P&gt;&lt;P&gt;InWeekToDate(Date,today(),0,0) *-1 as CurrentWeekToDate,&lt;BR /&gt;InWeekToDate(Date,today(),-1,0)*-1 as PreviousWeekToDate&lt;/P&gt;&lt;P&gt;Then you can use the below measure to compare&lt;/P&gt;&lt;P&gt;=sum({&amp;lt;CurrentWeekToDate={1}&amp;gt;}Sales)&lt;/P&gt;&lt;P&gt;=sum({&amp;lt;PreviousWeekToDate={1}&amp;gt;}Sales)&lt;/P&gt;&lt;P&gt;Another way is to use below measures. Last parameter in function&amp;nbsp;WeekStart &amp;amp; WeekEnd is 0 which means first day of the week is Monday(0) . You can change it according to your requirement&lt;/P&gt;&lt;P&gt;=sum({&amp;lt;Date ={"&amp;gt;=$(=date(weekstart(today(),0,0)))&amp;lt;=$(=date(weekend(today(),0,0)))"}&amp;gt;}Sales) // current week&lt;/P&gt;&lt;P&gt;=sum({&amp;lt;Date ={"&amp;gt;=$(=date(weekstart(today(),-1,0)))&amp;lt;=$(=date(weekend(today(),-1,0)))"}&amp;gt;}Sales) // Previous week&lt;/P&gt;</description>
    <pubDate>Fri, 18 Sep 2020 09:22:04 GMT</pubDate>
    <dc:creator>Kushal_Chawda</dc:creator>
    <dc:date>2020-09-18T09:22:04Z</dc:date>
    <item>
      <title>Week to date comparison</title>
      <link>https://community.qlik.com/t5/App-Development/Week-to-date-comparison/m-p/1744988#M57160</link>
      <description>&lt;P&gt;Hi guys,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to compare week on week performance, by comparing week to date - so for example Monday/Tuesday/Wednesday of this weeek versus Monday/Tuesday/Wednesday of last week.&lt;/P&gt;&lt;P&gt;I'm able to compare the Monday vs Monday, Tuesday vs Tuesday etc but not total up the week as it goes through as a whole.&lt;/P&gt;&lt;P&gt;Had been using this&amp;nbsp;&lt;SPAN&gt;sum ({$&amp;lt; date = {'$(=date(today(0)-7))'}&amp;gt;}&amp;nbsp; sales) as a day this week vs day last.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any ideas how to have this run from Monday - Sunday and compare Week on Week.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks!&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Dec 2021 21:08:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Week-to-date-comparison/m-p/1744988#M57160</guid>
      <dc:creator>MattOtoole</dc:creator>
      <dc:date>2021-12-20T21:08:46Z</dc:date>
    </item>
    <item>
      <title>Re: Week to date comparison</title>
      <link>https://community.qlik.com/t5/App-Development/Week-to-date-comparison/m-p/1744999#M57162</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/126233"&gt;@MattOtoole&lt;/a&gt;&amp;nbsp; &amp;nbsp;There are couple of ways you can do it. Below way is to create the Flags in script. Last parameter in function&amp;nbsp;InWeekToDate is 0 which means first day of the week is Monday(0) . You can change it according to your requirement&lt;/P&gt;&lt;P&gt;InWeekToDate(Date,today(),0,0) *-1 as CurrentWeekToDate,&lt;BR /&gt;InWeekToDate(Date,today(),-1,0)*-1 as PreviousWeekToDate&lt;/P&gt;&lt;P&gt;Then you can use the below measure to compare&lt;/P&gt;&lt;P&gt;=sum({&amp;lt;CurrentWeekToDate={1}&amp;gt;}Sales)&lt;/P&gt;&lt;P&gt;=sum({&amp;lt;PreviousWeekToDate={1}&amp;gt;}Sales)&lt;/P&gt;&lt;P&gt;Another way is to use below measures. Last parameter in function&amp;nbsp;WeekStart &amp;amp; WeekEnd is 0 which means first day of the week is Monday(0) . You can change it according to your requirement&lt;/P&gt;&lt;P&gt;=sum({&amp;lt;Date ={"&amp;gt;=$(=date(weekstart(today(),0,0)))&amp;lt;=$(=date(weekend(today(),0,0)))"}&amp;gt;}Sales) // current week&lt;/P&gt;&lt;P&gt;=sum({&amp;lt;Date ={"&amp;gt;=$(=date(weekstart(today(),-1,0)))&amp;lt;=$(=date(weekend(today(),-1,0)))"}&amp;gt;}Sales) // Previous week&lt;/P&gt;</description>
      <pubDate>Fri, 18 Sep 2020 09:22:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Week-to-date-comparison/m-p/1744999#M57162</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2020-09-18T09:22:04Z</dc:date>
    </item>
  </channel>
</rss>

