<?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 Latest date based on other field in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Latest-date-based-on-other-field/m-p/272065#M1180684</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Bingo &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did not know that I can put conditions in FirstSortedValue function. Thanks a lot. That works perfectly &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 04 Dec 2011 20:56:16 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-12-04T20:56:16Z</dc:date>
    <item>
      <title>Latest date based on other field</title>
      <link>https://community.qlik.com/t5/QlikView/Latest-date-based-on-other-field/m-p/272061#M1180680</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a pivot table (file Table1 in attachement) and I would like to calculate a latest price for every material in list. I am using set analysis and everything is OK until I ask for latest date. Then I get a problem. It will not calculate if there are few different prices. Table2 is the file with prices and other dimensions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here are conditions: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sales_SoldToParty must be BPTQB&lt;/P&gt;&lt;P&gt;Sales_SAPNumber must be 115111&lt;/P&gt;&lt;P&gt;SalesDate must be latest date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;those three conditions will determin price for one material. It sounds easy but its not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried: sum({&amp;lt;Sales_SoldToParty={'BPTQB'}, Sales_SAPNumber={115111}, SalesDate={$(=max(SalesDate))}&amp;gt;} SalesPrice) but it wont work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried aggr(FirstSortedValue(SalesPrice, -SalesDate), VCCOHS) and this gives me latest prices but other conditions are not included. So I tried with set analysis and have done this: sum({&amp;lt;Sales_SoldToParty={'BPTQB'}, Sales_SAPNumber={115111}&amp;gt;} aggr(FirstSortedValue(SalesPrice, -SalesDate), VCCOHS)) but this works only if I have one row in database (Table2 in attachemnt). Is there any other solutions to include conditions in aggr function without set analysis?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, if someone has an idea how to summarize latest prices for whole sequences from one database and two other conditions, please help. Att the moment I am using private licence so I can not open other qlikview files. If you can write a formula or have idea here it will be great if you write it here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS: This does not work either: if(aggr(Sales_SAPNumber,SalesVCC)=115111 and aggr(Sales_SoldToParty ,SalesVCC)='BPTQB', aggr(FirstSortedValue(SalesPrice, -SalesDate), VCCOHS))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Dec 2011 14:56:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Latest-date-based-on-other-field/m-p/272061#M1180680</guid>
      <dc:creator />
      <dc:date>2011-12-01T14:56:32Z</dc:date>
    </item>
    <item>
      <title>Latest date based on other field</title>
      <link>https://community.qlik.com/t5/QlikView/Latest-date-based-on-other-field/m-p/272062#M1180681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Somebody?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 04 Dec 2011 20:04:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Latest-date-based-on-other-field/m-p/272062#M1180681</guid>
      <dc:creator />
      <dc:date>2011-12-04T20:04:58Z</dc:date>
    </item>
    <item>
      <title>Latest date based on other field</title>
      <link>https://community.qlik.com/t5/QlikView/Latest-date-based-on-other-field/m-p/272063#M1180682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It may be helpful if you posted a sample qvw.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 04 Dec 2011 20:27:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Latest-date-based-on-other-field/m-p/272063#M1180682</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2011-12-04T20:27:21Z</dc:date>
    </item>
    <item>
      <title>Latest date based on other field</title>
      <link>https://community.qlik.com/t5/QlikView/Latest-date-based-on-other-field/m-p/272064#M1180683</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 assumed that your fields VCCOHS and SalesVCC are associated so I renamed VCCOHS to SalesVCC in my script to get the tables linked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, if you create a table chart with dimension SalesVCC, you could use this as expression:&lt;/P&gt;&lt;P&gt;=FirstSortedValue({&amp;lt;Sales_SAPNumber={'115111'}, Sales_SoldToParty={'BPTQB'}&amp;gt;} SalesPrice, -SalesDate)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Very similar to your one approach, just added the set expression to limit on SAP# and SoldToParty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 04 Dec 2011 20:36:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Latest-date-based-on-other-field/m-p/272064#M1180683</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-12-04T20:36:44Z</dc:date>
    </item>
    <item>
      <title>Latest date based on other field</title>
      <link>https://community.qlik.com/t5/QlikView/Latest-date-based-on-other-field/m-p/272065#M1180684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Bingo &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did not know that I can put conditions in FirstSortedValue function. Thanks a lot. That works perfectly &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 04 Dec 2011 20:56:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Latest-date-based-on-other-field/m-p/272065#M1180684</guid>
      <dc:creator />
      <dc:date>2011-12-04T20:56:16Z</dc:date>
    </item>
  </channel>
</rss>

