<?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: Fix the last week in a expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Fix-the-last-week-in-a-expression/m-p/798911#M661501</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;&lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;week&lt;/SPAN&gt;( '1971-10-30' )&lt;/SPAN&gt; returns &lt;SPAN class="Italic"&gt;43 ---take latest week always.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;else play with these&lt;/SPAN&gt;&lt;/P&gt;&lt;OL class="dp-c" start="1" style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #5c5c5c; margin-bottom: 1px !important; margin-left: 45px !important;"&gt;&lt;LI&gt;&lt;SPAN style="color: black; font-size: 9pt !important; font-style: inherit; background-color: inherit; font-weight: inherit;"&gt;LET vCurrentWeek = week(today());&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;LET vPreviousWeek = week(today()-7);&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;LET vCurrentYear = year(today());&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;LET vPreviousYear = year(today()-7);&amp;nbsp; whichever u need.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Feb 2015 17:24:05 GMT</pubDate>
    <dc:creator>buzzy996</dc:creator>
    <dc:date>2015-02-26T17:24:05Z</dc:date>
    <item>
      <title>Fix the last week in a expression</title>
      <link>https://community.qlik.com/t5/QlikView/Fix-the-last-week-in-a-expression/m-p/798910#M661500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi!&lt;/P&gt;&lt;P&gt;I would like to know if is posible this issue:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a ítem call "week", every week, the DB is updated with the last week information added.&lt;/P&gt;&lt;P&gt;i want to fix in the scripting of a chart expression only to show the last week information,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this posible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Feb 2015 17:15:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Fix-the-last-week-in-a-expression/m-p/798910#M661500</guid>
      <dc:creator />
      <dc:date>2015-02-26T17:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: Fix the last week in a expression</title>
      <link>https://community.qlik.com/t5/QlikView/Fix-the-last-week-in-a-expression/m-p/798911#M661501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;&lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;week&lt;/SPAN&gt;( '1971-10-30' )&lt;/SPAN&gt; returns &lt;SPAN class="Italic"&gt;43 ---take latest week always.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;else play with these&lt;/SPAN&gt;&lt;/P&gt;&lt;OL class="dp-c" start="1" style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #5c5c5c; margin-bottom: 1px !important; margin-left: 45px !important;"&gt;&lt;LI&gt;&lt;SPAN style="color: black; font-size: 9pt !important; font-style: inherit; background-color: inherit; font-weight: inherit;"&gt;LET vCurrentWeek = week(today());&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;LET vPreviousWeek = week(today()-7);&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;LET vCurrentYear = year(today());&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;LET vPreviousYear = year(today()-7);&amp;nbsp; whichever u need.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Feb 2015 17:24:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Fix-the-last-week-in-a-expression/m-p/798911#M661501</guid>
      <dc:creator>buzzy996</dc:creator>
      <dc:date>2015-02-26T17:24:05Z</dc:date>
    </item>
    <item>
      <title>Re: Fix the last week in a expression</title>
      <link>https://community.qlik.com/t5/QlikView/Fix-the-last-week-in-a-expression/m-p/798912#M661502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No, this does not work, is inside the expression of a table chart:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now I am trying with a week_id that has numbers( 1,2,..53) and fixing in the expression the last week but i do not know how to do the expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example if i am in 43 week id and i want (without sellecting in qlikview) inside the expression fix in the chart always the last week i mean the week 42.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is an stupid example because i dont know how... thanks&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;STRONG style=": ; color: #ff0000; font-size: 8pt;"&gt;(&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;{$&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[week_id]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;=(&lt;SPAN style="color: #800000;"&gt;week_id -(week_id-1)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;gt;}pax &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; How can i do it in a expression like this? thanks a lot for your support&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Feb 2015 17:48:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Fix-the-last-week-in-a-expression/m-p/798912#M661502</guid>
      <dc:creator />
      <dc:date>2015-02-26T17:48:11Z</dc:date>
    </item>
    <item>
      <title>Re: Fix the last week in a expression</title>
      <link>https://community.qlik.com/t5/QlikView/Fix-the-last-week-in-a-expression/m-p/798913#M661503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you have a Date field in your data?&amp;nbsp; If yes, you don't need week id at all, just use condition in the expression to calculate the data for the Dates in the current week, for example&lt;/P&gt;&lt;P&gt;sum(if(InWeek(Date, today(),0),pax))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Feb 2015 18:00:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Fix-the-last-week-in-a-expression/m-p/798913#M661503</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-02-26T18:00:32Z</dc:date>
    </item>
    <item>
      <title>Re: Fix the last week in a expression</title>
      <link>https://community.qlik.com/t5/QlikView/Fix-the-last-week-in-a-expression/m-p/798914#M661504</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Michael. It Works!.. but to complicate more things my weeks are difined from saturday to friday.. Not from monday to sunday .. is there any way to change InWeek in this ranges?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Feb 2015 18:54:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Fix-the-last-week-in-a-expression/m-p/798914#M661504</guid>
      <dc:creator />
      <dc:date>2015-02-26T18:54:10Z</dc:date>
    </item>
    <item>
      <title>Re: Fix the last week in a expression</title>
      <link>https://community.qlik.com/t5/QlikView/Fix-the-last-week-in-a-expression/m-p/798915#M661505</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In fact - yes.&amp;nbsp; There is the 4th optional parameter in the InWeek() function for the week start.&amp;nbsp; Probably it is -2 in your case, but I'm not sure, try to experiment with it:&lt;/P&gt;&lt;P&gt;sum(if(InWeek(Date, today(),0,-&lt;STRONG&gt;2&lt;/STRONG&gt;),pax))&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Feb 2015 18:59:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Fix-the-last-week-in-a-expression/m-p/798915#M661505</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-02-26T18:59:51Z</dc:date>
    </item>
    <item>
      <title>Re: Fix the last week in a expression</title>
      <link>https://community.qlik.com/t5/QlikView/Fix-the-last-week-in-a-expression/m-p/798916#M661507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Michael! you have been very helpful!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Feb 2015 19:04:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Fix-the-last-week-in-a-expression/m-p/798916#M661507</guid>
      <dc:creator />
      <dc:date>2015-02-26T19:04:13Z</dc:date>
    </item>
  </channel>
</rss>

