<?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: Chart based on latest data in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Chart-based-on-latest-data/m-p/616039#M684901</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shanthi, You can't use the set analysis here because set analysis is calculated not row by row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Best method is create the script level suggested by Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Feb 2014 14:48:08 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-02-07T14:48:08Z</dc:date>
    <item>
      <title>Chart based on latest data</title>
      <link>https://community.qlik.com/t5/QlikView/Chart-based-on-latest-data/m-p/616032#M684894</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;Need to display the latest data based on date and other dimensions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to show the latest stock available in the stores. Need to plot a chart with store in X axis and latest stock information(Based on the date) for that store in y axis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Date&amp;nbsp;&amp;nbsp;&amp;nbsp; Store,&amp;nbsp; Product,&amp;nbsp;&amp;nbsp;&amp;nbsp; Stock&lt;/P&gt;&lt;P&gt;1-Jan,&amp;nbsp;&amp;nbsp; A,&amp;nbsp; P1,&amp;nbsp;&amp;nbsp; 100&lt;/P&gt;&lt;P&gt;2-Jan,&amp;nbsp;&amp;nbsp; A,&amp;nbsp; P1,&amp;nbsp; 70&lt;/P&gt;&lt;P&gt;2-Jan, A,&amp;nbsp; P2,&amp;nbsp; 20&lt;/P&gt;&lt;P&gt;1-Jan,&amp;nbsp; B,&amp;nbsp; P1,&amp;nbsp; 20&lt;/P&gt;&lt;P&gt;1-Jan, B, P2,&amp;nbsp; 10&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My chart should like like below&lt;/P&gt;&lt;P&gt;Store,&amp;nbsp;&amp;nbsp; Stock&lt;/P&gt;&lt;P&gt;A,&amp;nbsp; 90&lt;/P&gt;&lt;P&gt;B,&amp;nbsp; 30&lt;/P&gt;&lt;P&gt;Pls Suggest some solutions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Feb 2014 13:18:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Chart-based-on-latest-data/m-p/616032#M684894</guid>
      <dc:creator />
      <dc:date>2014-02-06T13:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: Chart based on latest data</title>
      <link>https://community.qlik.com/t5/QlikView/Chart-based-on-latest-data/m-p/616033#M684895</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;For best performance, I would calculate a flag field in script to mark the latest value by store:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;T_MaxDates:&lt;/P&gt;&lt;P&gt;LOAD Max(Date) As MaxDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Store&lt;/P&gt;&lt;P&gt;Resident Data&lt;/P&gt;&lt;P&gt;Group By Store;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Join(Data)&lt;/P&gt;&lt;P&gt;LOAD Store,&lt;/P&gt;&lt;P&gt;&amp;nbsp; MaxDate&lt;/P&gt;&lt;P&gt;Resident T_MaxDates;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Join(Date)&lt;/P&gt;&lt;P&gt;LOAD Store,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Date,&lt;/P&gt;&lt;P&gt;&amp;nbsp; If(Date = MaxDate, 1, 0) As LastDateFlag&lt;/P&gt;&lt;P&gt;Resident Data;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP Table T_MaxDates;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then your chart expressions become simple (and fast):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; =Sum({&amp;lt;LastDateFlag = {1}&amp;gt;} Stock)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Feb 2014 13:28:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Chart-based-on-latest-data/m-p/616033#M684895</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2014-02-06T13:28:35Z</dc:date>
    </item>
    <item>
      <title>Re: Chart based on latest data</title>
      <link>https://community.qlik.com/t5/QlikView/Chart-based-on-latest-data/m-p/616034#M684896</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jonathan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your solution works fine. But I have to find the latest date flag for many dimesional level. Is there any way to do it in chart expression itseslf?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something like&lt;/P&gt;&lt;P&gt;firstsortedvalue(aggr(sum(Stock),Store,Date),-Date)...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Feb 2014 06:42:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Chart-based-on-latest-data/m-p/616034#M684896</guid>
      <dc:creator />
      <dc:date>2014-02-07T06:42:26Z</dc:date>
    </item>
    <item>
      <title>Re: Chart based on latest data</title>
      <link>https://community.qlik.com/t5/QlikView/Chart-based-on-latest-data/m-p/616035#M684897</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;take Date from store table store in variable&lt;/P&gt;&lt;P&gt;like vLatestDate =max(Date)&lt;/P&gt;&lt;P&gt;pass this in chart using set analysis&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Feb 2014 07:02:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Chart-based-on-latest-data/m-p/616035#M684897</guid>
      <dc:creator />
      <dc:date>2014-02-07T07:02:55Z</dc:date>
    </item>
    <item>
      <title>Re: Chart based on latest data</title>
      <link>https://community.qlik.com/t5/QlikView/Chart-based-on-latest-data/m-p/616036#M684898</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Shanti,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create 1 variable vMaxDate&lt;/P&gt;&lt;P&gt;= Max(Date)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;make Bar Chart&lt;/P&gt;&lt;P&gt;Take Dimension as a Store&lt;/P&gt;&lt;P&gt;And try below Expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Sum({&amp;lt;Date={"$(vMaxDate)"}&amp;gt;}Stock)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;BR /&gt;Kiran Rode&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Feb 2014 07:09:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Chart-based-on-latest-data/m-p/616036#M684898</guid>
      <dc:creator>kiranmanoharrode</dc:creator>
      <dc:date>2014-02-07T07:09:14Z</dc:date>
    </item>
    <item>
      <title>Re: Chart based on latest data</title>
      <link>https://community.qlik.com/t5/QlikView/Chart-based-on-latest-data/m-p/616037#M684899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We cannot use a variable as it will always show the maximum date of the stock available irrespective of the Store. For each store the maximum date will vary. So we have to do find out the maximum date for each store to get the latest stock information&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Feb 2014 10:46:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Chart-based-on-latest-data/m-p/616037#M684899</guid>
      <dc:creator />
      <dc:date>2014-02-07T10:46:32Z</dc:date>
    </item>
    <item>
      <title>Re: Chart based on latest data</title>
      <link>https://community.qlik.com/t5/QlikView/Chart-based-on-latest-data/m-p/616038#M684900</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;FirstSortedValue(Aggr(sum(Stock),DATE,Store),-Aggr(max(DATE),Store))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Feb 2014 11:41:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Chart-based-on-latest-data/m-p/616038#M684900</guid>
      <dc:creator>er_mohit</dc:creator>
      <dc:date>2014-02-07T11:41:42Z</dc:date>
    </item>
    <item>
      <title>Re: Chart based on latest data</title>
      <link>https://community.qlik.com/t5/QlikView/Chart-based-on-latest-data/m-p/616039#M684901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shanthi, You can't use the set analysis here because set analysis is calculated not row by row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Best method is create the script level suggested by Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Feb 2014 14:48:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Chart-based-on-latest-data/m-p/616039#M684901</guid>
      <dc:creator />
      <dc:date>2014-02-07T14:48:08Z</dc:date>
    </item>
  </channel>
</rss>

