<?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: Set Analysis for Summing two or more values for latest transaction date in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis-for-Summing-two-or-more-values-for-latest/m-p/448033#M490542</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Kiran,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Its a tricky one. You can use the below one to get the desired result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUM({&amp;lt;Date = {$(=CHR(39)&amp;amp;CONCAT(aggr(mAX({&amp;lt;Date = {"&amp;gt;=$(vFromDate) &amp;lt;=$(vToDate) "}&amp;gt;}Date),Item),CHR(39)&amp;amp;','&amp;amp;CHR(39))&amp;amp;CHR(39))}&amp;gt;} UnitCost)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The formula is as follows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chr(39) is for&amp;nbsp; ' (single quote)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vFromDate and vToDate are variables from two calendar provided to users&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;we are trying to get Maximum date for each itemid (in your case it might be other dimension) fro the selected two dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since each item can have there own maximum dates and hence we need to use concat function to get multiple dates&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Our expression will be read by qlikview as &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUM({&amp;lt;Date = {'01/01/2012','02/02/2012'} UnitCost)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where 01/01/2012 will be maximum date for item A&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;02/02/2012 will be maximum date for item B&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope its clear. If not then let me know&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Deepak&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Sep 2012 12:17:15 GMT</pubDate>
    <dc:creator>deepakk</dc:creator>
    <dc:date>2012-09-27T12:17:15Z</dc:date>
    <item>
      <title>Set Analysis for Summing two or more values for latest transaction date</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-for-Summing-two-or-more-values-for-latest/m-p/448032#M490541</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to write set expression for following condition :&lt;/P&gt;&lt;P&gt;For one item,check latest transaction date.&lt;/P&gt;&lt;P&gt;Get the Unit Cost for that Latest Transaction Date,&lt;/P&gt;&lt;P&gt;If multiple unit cost present then sum (Unit Cost) over that same transaction &amp;amp; show this value against that Item in straight table.&lt;/P&gt;&lt;P&gt;How I can do this?&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, 27 Sep 2012 10:03:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-for-Summing-two-or-more-values-for-latest/m-p/448032#M490541</guid>
      <dc:creator />
      <dc:date>2012-09-27T10:03:00Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis for Summing two or more values for latest transaction date</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-for-Summing-two-or-more-values-for-latest/m-p/448033#M490542</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Kiran,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Its a tricky one. You can use the below one to get the desired result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUM({&amp;lt;Date = {$(=CHR(39)&amp;amp;CONCAT(aggr(mAX({&amp;lt;Date = {"&amp;gt;=$(vFromDate) &amp;lt;=$(vToDate) "}&amp;gt;}Date),Item),CHR(39)&amp;amp;','&amp;amp;CHR(39))&amp;amp;CHR(39))}&amp;gt;} UnitCost)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The formula is as follows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chr(39) is for&amp;nbsp; ' (single quote)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vFromDate and vToDate are variables from two calendar provided to users&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;we are trying to get Maximum date for each itemid (in your case it might be other dimension) fro the selected two dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since each item can have there own maximum dates and hence we need to use concat function to get multiple dates&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Our expression will be read by qlikview as &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUM({&amp;lt;Date = {'01/01/2012','02/02/2012'} UnitCost)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where 01/01/2012 will be maximum date for item A&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;02/02/2012 will be maximum date for item B&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope its clear. If not then let me know&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Deepak&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Sep 2012 12:17:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-for-Summing-two-or-more-values-for-latest/m-p/448033#M490542</guid>
      <dc:creator>deepakk</dc:creator>
      <dc:date>2012-09-27T12:17:15Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis for Summing two or more values for latest transaction date</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-for-Summing-two-or-more-values-for-latest/m-p/448034#M490543</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Deepak,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have explained in very simplified manner.&lt;/P&gt;&lt;P&gt;I got the desired soultion by using Set Expression given by you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your correct reply,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2012 09:31:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-for-Summing-two-or-more-values-for-latest/m-p/448034#M490543</guid>
      <dc:creator />
      <dc:date>2012-10-03T09:31:40Z</dc:date>
    </item>
  </channel>
</rss>

