<?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: How to show only last 3 weeks data ? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-show-only-last-3-weeks-data/m-p/556811#M1123768</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;Using Set analysis also you can do that,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Times New Roman','serif'; color: black;"&gt;avg({&amp;lt;Date={"&amp;gt;$(=WeekStart(max(Date),-2))&amp;lt;=$(=Date(max(Date)))"}&amp;gt;}Availaibility) &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Times New Roman','serif'; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Times New Roman','serif'; color: black;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Times New Roman','serif'; color: black;"&gt;Nirav Bhimani&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 Jan 2014 16:26:51 GMT</pubDate>
    <dc:creator>nirav_bhimani</dc:creator>
    <dc:date>2014-01-06T16:26:51Z</dc:date>
    <item>
      <title>How to show only last 3 weeks data ?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-show-only-last-3-weeks-data/m-p/556805#M1123762</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;I am quite new to Qlikview. I have one expression as&lt;/P&gt;&lt;P&gt;=AVG(if(Week(A_Timestamp)=Week(Now())-2,Availaibility))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Problem is if I didn't get feeds for last few weeks, my dimension show empty values. I don't want that to happen and want to show data not in comparison to current date but in comparison to max date value in my database.&lt;/P&gt;&lt;P&gt;Something like&lt;/P&gt;&lt;P&gt;=AVG(if(Week(A_Timestamp)=Max(Week(A_Timestamp))-2,Availaibility))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone help me with correct expression to be used ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jan 2014 15:43:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-show-only-last-3-weeks-data/m-p/556805#M1123762</guid>
      <dc:creator />
      <dc:date>2014-01-06T15:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to show only last 3 weeks data ?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-show-only-last-3-weeks-data/m-p/556806#M1123763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you upload your sample data file?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jan 2014 15:58:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-show-only-last-3-weeks-data/m-p/556806#M1123763</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2014-01-06T15:58:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to show only last 3 weeks data ?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-show-only-last-3-weeks-data/m-p/556807#M1123764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Arpit&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then you have to store somewhere MaxDate =max(Date)&amp;nbsp; and use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=AVG(if(Week($(MaxDate))=Max(Week($(MaxDate)))-2,Availaibility))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jan 2014 16:01:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-show-only-last-3-weeks-data/m-p/556807#M1123764</guid>
      <dc:creator />
      <dc:date>2014-01-06T16:01:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to show only last 3 weeks data ?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-show-only-last-3-weeks-data/m-p/556808#M1123765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try something like this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Under your script...add one more line&lt;/P&gt;&lt;P&gt;WEEK(A_Timestamp) = Week&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Availability of last three weeks&lt;/P&gt;&lt;P&gt;=Avg({&amp;lt;Week = {"&amp;gt;=$(=Max(Week(A_Timestamp))-2)"}&amp;gt;}Availability)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As per your question...&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.727272033691406px;"&gt;=Avg({&amp;lt;Week = {"$(=Max(Week(A_Timestamp))-2)"}&amp;gt;}Availability)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jan 2014 16:03:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-show-only-last-3-weeks-data/m-p/556808#M1123765</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2014-01-06T16:03:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to show only last 3 weeks data ?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-show-only-last-3-weeks-data/m-p/556809#M1123766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could use set analysis instead of an if statement. Example,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Avg({$&amp;lt;Week={$(=Max(A_Timestamp)-3)}&amp;gt;} Availability)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As for the dates with no data.&amp;nbsp; If there is a date entry in the A_Timestamp and just no associated data you, in the script you could do a simple if statement, if(Len(&amp;lt;name of field with null data&amp;gt;) = 0, 0, &amp;lt;name of field with null data&amp;gt;) as newfield&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will create a field with 0's instead of Nulls (not sure if that is what youre looking for tho)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jan 2014 16:07:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-show-only-last-3-weeks-data/m-p/556809#M1123766</guid>
      <dc:creator>jpapador</dc:creator>
      <dc:date>2014-01-06T16:07:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to show only last 3 weeks data ?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-show-only-last-3-weeks-data/m-p/556810#M1123767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Arpit,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try something like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Avg({&amp;lt;Date={"&amp;gt;=$(=Date(WeekStart(max({$}Date))-14))"}&amp;gt;} Availability)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can change WeekStart to WeekEnd or just use Max Date and subtract 21 days etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if Max Date is 1/5/2014, then WeekStart of 1/5/2014 is 12/30/2013.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you use Week() then if your data is for Jan or Feb, &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Max(Week(A_Timestamp))-2&lt;/SPAN&gt; will gibe you -1. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sean&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jan 2014 16:19:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-show-only-last-3-weeks-data/m-p/556810#M1123767</guid>
      <dc:creator />
      <dc:date>2014-01-06T16:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to show only last 3 weeks data ?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-show-only-last-3-weeks-data/m-p/556811#M1123768</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;Using Set analysis also you can do that,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Times New Roman','serif'; color: black;"&gt;avg({&amp;lt;Date={"&amp;gt;$(=WeekStart(max(Date),-2))&amp;lt;=$(=Date(max(Date)))"}&amp;gt;}Availaibility) &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Times New Roman','serif'; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Times New Roman','serif'; color: black;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Times New Roman','serif'; color: black;"&gt;Nirav Bhimani&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jan 2014 16:26:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-show-only-last-3-weeks-data/m-p/556811#M1123768</guid>
      <dc:creator>nirav_bhimani</dc:creator>
      <dc:date>2014-01-06T16:26:51Z</dc:date>
    </item>
  </channel>
</rss>

