<?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 expression set analysis only works with flat file in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Chart-expression-set-analysis-only-works-with-flat-file/m-p/522155#M556549</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;date needs to be correctly parsed in as a date (i.e. having a numeric representation) to make FirstSortedValue() work (sort weight needs to be numeric).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check that date field has a numeric representation (e.g. check the tags in table view, or using num(date)).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe you need to use Date#() interpretation function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;Date#(date, 'MM/DD/YYYY') as date&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 28 Jun 2013 17:37:22 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2013-06-28T17:37:22Z</dc:date>
    <item>
      <title>Chart expression set analysis only works with flat file</title>
      <link>https://community.qlik.com/t5/QlikView/Chart-expression-set-analysis-only-works-with-flat-file/m-p/522154#M556548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have an expression that works when my data source is directly from the xlsx file, but not when the xlsx file is imported to a DB which is used as the source data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Chart expression&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Sum ({&amp;lt;version = {'$(=FirstSortedValue(version, -date))'} &amp;gt;} cases)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should grab the version associated with the most recent date.&amp;nbsp; I can't use "Max(version)" instead of "FirstSortedValue(version, -date)" because version is not a number, but in the formate of a program version, e.g. "3.0.1.355".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Load statement that makes the chart expression work&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;LOAD date, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; version,&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[\\ftp1\VersionDates.xlsx]&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is Sheet1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Load statement &lt;/STRONG&gt;&lt;STRONG&gt;that makes the chart expression NOT work&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date(date, 'MM/DD/YYYY') as date,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; version;&lt;/P&gt;&lt;P&gt;SQL&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; select&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; convert(varchar(10), date, 120) as date,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; version&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; from DB1..Version_Dates;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Jun 2013 17:33:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Chart-expression-set-analysis-only-works-with-flat-file/m-p/522154#M556548</guid>
      <dc:creator />
      <dc:date>2013-06-28T17:33:39Z</dc:date>
    </item>
    <item>
      <title>Re: Chart expression set analysis only works with flat file</title>
      <link>https://community.qlik.com/t5/QlikView/Chart-expression-set-analysis-only-works-with-flat-file/m-p/522155#M556549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;date needs to be correctly parsed in as a date (i.e. having a numeric representation) to make FirstSortedValue() work (sort weight needs to be numeric).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check that date field has a numeric representation (e.g. check the tags in table view, or using num(date)).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe you need to use Date#() interpretation function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;Date#(date, 'MM/DD/YYYY') as date&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Jun 2013 17:37:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Chart-expression-set-analysis-only-works-with-flat-file/m-p/522155#M556549</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-06-28T17:37:22Z</dc:date>
    </item>
    <item>
      <title>Re: Chart expression set analysis only works with flat file</title>
      <link>https://community.qlik.com/t5/QlikView/Chart-expression-set-analysis-only-works-with-flat-file/m-p/522156#M556550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried num() and Date#() functions with no luck.&amp;nbsp; I'm pretty sure "date" is being parsed as a number since it's showing up in MM/DD/YYYY format and if I make a list box for that field, the default sort is by Numeric Value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Jun 2013 19:59:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Chart-expression-set-analysis-only-works-with-flat-file/m-p/522156#M556550</guid>
      <dc:creator />
      <dc:date>2013-06-28T19:59:56Z</dc:date>
    </item>
    <item>
      <title>Re: Chart expression set analysis only works with flat file</title>
      <link>https://community.qlik.com/t5/QlikView/Chart-expression-set-analysis-only-works-with-flat-file/m-p/522157#M556551</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Aren't you explicitely converting your date to text in your SQL?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Jun 2013 20:09:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Chart-expression-set-analysis-only-works-with-flat-file/m-p/522157#M556551</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-06-28T20:09:49Z</dc:date>
    </item>
    <item>
      <title>Re: Chart expression set analysis only works with flat file</title>
      <link>https://community.qlik.com/t5/QlikView/Chart-expression-set-analysis-only-works-with-flat-file/m-p/522158#M556552</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, it was converted to text (red) then back to date formate (blue) and it seems to be seeing it as a date as far as I can tell.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;Date(date, 'MM/DD/YYYY') &lt;/SPAN&gt;as date,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; version;&lt;/P&gt;&lt;P&gt;SQL&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; select&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #ff0000;"&gt;convert(varchar(10), date, 120) &lt;/SPAN&gt;as date,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; version&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; from DB1..Version_Dates;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried not specifying any data format in the load script like the example below, then using Date(), Date#() and Num() in the expression, but still no dice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; date,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; version;&lt;/P&gt;&lt;P&gt;SQL&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; select&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; version&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; from DB1..Version_Dates;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it helps, as it appears in the DB version, the dates look like this:&lt;/P&gt;&lt;P&gt;2012-06-27 00:00:00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does that help?&amp;nbsp; Any other ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Jun 2013 21:01:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Chart-expression-set-analysis-only-works-with-flat-file/m-p/522158#M556552</guid>
      <dc:creator />
      <dc:date>2013-06-28T21:01:29Z</dc:date>
    </item>
    <item>
      <title>Re: Chart expression set analysis only works with flat file</title>
      <link>https://community.qlik.com/t5/QlikView/Chart-expression-set-analysis-only-works-with-flat-file/m-p/522159#M556553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Date(date, 'MM/DD/YYYY') is not converting it back. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" class="loading" href="https://community.qlik.com/blogs/qlikviewdesignblog/2013/02/19/why-don-t-my-dates-work"&gt;http://community.qlik.com/blogs/qlikviewdesignblog/2013/02/19/why-don-t-my-dates-work&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" class="loading active_link" href="https://community.qlik.com/docs/DOC-3102"&gt;http://community.qlik.com/docs/DOC-3102&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your date as returned from your SQL looks like 2012-06-27,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date(Date#( date, 'YYYY-MM-DD'),'MM/DD/YYYY') as date,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; version;&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Jun 2013 21:24:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Chart-expression-set-analysis-only-works-with-flat-file/m-p/522159#M556553</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-06-28T21:24:06Z</dc:date>
    </item>
    <item>
      <title>Re: Chart expression set analysis only works with flat file</title>
      <link>https://community.qlik.com/t5/QlikView/Chart-expression-set-analysis-only-works-with-flat-file/m-p/522160#M556554</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Very useful documents!&amp;nbsp; I am saving them in case I need to refer to them again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, I still have the issue.&amp;nbsp; I read all the pages and I tried your solution as well as this similar one, since the original format is timestamped:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Date(Date#( date, 'YYYY-MM-DD h:mm:ss'),'MM/DD/YYYY') as date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm beginning to wonder if this is something else besides date format, since what you gave me was very thorough. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Interestingly, I tried adding this to the load script to see if I could use a field value when there's only one row instead of the function FirstSortedValue to get around the issue:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: blue; font-size: 9.0pt; font-family: 'Courier New';"&gt;LOAD&lt;/STRONG&gt; &lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;date&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;version&lt;/SPAN&gt; &lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;current_version&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;Resident&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; DateTable&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;Where&lt;/SPAN&gt; &lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;date&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;Max&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;date&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I was unable to make this work, since when I reloaded the data, the script crashed: "Execution of script failed.&amp;nbsp; Reload old data?"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Jun 2013 21:58:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Chart-expression-set-analysis-only-works-with-flat-file/m-p/522160#M556554</guid>
      <dc:creator />
      <dc:date>2013-06-28T21:58:36Z</dc:date>
    </item>
    <item>
      <title>Re: Chart expression set analysis only works with flat file</title>
      <link>https://community.qlik.com/t5/QlikView/Chart-expression-set-analysis-only-works-with-flat-file/m-p/522161#M556555</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you upload your qvw here to the forum? Upload is available in advanced editor or when editing an existing posting.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Jun 2013 23:11:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Chart-expression-set-analysis-only-works-with-flat-file/m-p/522161#M556555</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-06-28T23:11:58Z</dc:date>
    </item>
    <item>
      <title>Re: Chart expression set analysis only works with flat file</title>
      <link>https://community.qlik.com/t5/QlikView/Chart-expression-set-analysis-only-works-with-flat-file/m-p/522162#M556556</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your convert call in the sql statement creates a text field (varchar). You need to use the date# function if you want to create a date from it again. I suggest you kick out the convert call from the sql statement and just get date as it is:&lt;/P&gt;&lt;P&gt;SQL select date,version from ....&lt;/P&gt;&lt;P&gt;Or maybe &lt;EM&gt;cast(date as date) as date&lt;/EM&gt; if you want to get rid of the time part of the datetime.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you don't want to do that I suggest you take a good look at &lt;A href="http://www.sql-server-helper.com/tips/date-formats.aspx"&gt;this page&lt;/A&gt; to make sure you get back the datetime format you expect.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 29 Jun 2013 07:12:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Chart-expression-set-analysis-only-works-with-flat-file/m-p/522162#M556556</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-06-29T07:12:58Z</dc:date>
    </item>
    <item>
      <title>Re: Chart expression set analysis only works with flat file</title>
      <link>https://community.qlik.com/t5/QlikView/Chart-expression-set-analysis-only-works-with-flat-file/m-p/522163#M556557</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That didn't work either.&amp;nbsp; I don't know what's causing this, but at least I found a work around.&amp;nbsp; I associated all "version" strings to their row number and sorted by that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Load statement&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;//this table maps each date to a version&lt;/P&gt;&lt;P&gt;OriginalDateTable:&lt;/P&gt;&lt;P&gt;Load date,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; version;&lt;/P&gt;&lt;P&gt;SQL&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; select&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; version&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; from DB1..Version_Dates;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//this table allows ordering versions by how recent they are&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;VersionNumTable:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;Load version,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RowNo() as version_num&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;Resident OriginalDateTable;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//this table maps each date to a week and month for graphical displays&lt;/P&gt;&lt;P&gt;DateTable:&lt;/P&gt;&lt;P&gt;Load date,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; WeekStart(date) as week_of,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MonthStart(date) as month,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; version&lt;/P&gt;&lt;P&gt;Resident OriginalDateTable&lt;/P&gt;&lt;P&gt;Where not isnull(version);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop table OriginalDateTable;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Chart expression&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;Sum ({&amp;lt;version={'$(=FirstSortedValue(version, -version_num))'}&amp;gt;}cases)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for all your help everyone! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jul 2013 17:23:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Chart-expression-set-analysis-only-works-with-flat-file/m-p/522163#M556557</guid>
      <dc:creator />
      <dc:date>2013-07-01T17:23:27Z</dc:date>
    </item>
  </channel>
</rss>

