<?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: Aggr function and set analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Aggr-function-and-set-analysis/m-p/1153054#M376550</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I could not get that to work unfortunately. If I take out the max date expression and put it in a straight table with TOTAL &amp;lt;[Part Number]&amp;gt; added to it as below, it gives the result I want, but in the main expression it has no effect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;date(max({$&amp;lt;Part=,[Part Number]=, Planner=,[Work Station]=p([Work Station]) ,[Manual Supply]-={0},[Demand / Supply Date]=&amp;gt;}TOTAL &amp;lt;[Part Number]&amp;gt; [Demand / Supply Date])) &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 16 May 2016 10:43:03 GMT</pubDate>
    <dc:creator>chriswain2</dc:creator>
    <dc:date>2016-05-16T10:43:03Z</dc:date>
    <item>
      <title>Aggr function and set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function-and-set-analysis/m-p/1153051#M376547</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would normally be able to solve this by doing the work in the script, but I have to use the aggr method because I am using an input field which is not there in the script. It works except for one thing: I want it to evaluate the max date expression highlighted based on the current part number it has reached in the aggr loop, but it is evaluating it based on all possible part numbers. I always have one part number selected in the model. The principle I need is how to use the value it has reached in the aggr loop. Is that possible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;Part=,[Part Number]=,Planner=, [Work Station]= P([Work Station])&amp;gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;aggr&lt;/STRONG&gt;( sum({$&amp;lt;Part=,[Part Number]=,Planner=, [Work Station]= P([Work Station])&amp;gt;-&amp;lt;Part=,Planner=, [Work Station]= P([Work Station]),[Part Number]={$(vPartsWithManualAdjustments)},&lt;/P&gt;&lt;P&gt;[Demand / Supply Date]={"&amp;lt;=$(&lt;STRONG&gt;=max({$&amp;lt;Part=,[Part Number]=,Planner=, [Work Station]= P([Work Station]) ,[Manual Supply]-={0}&amp;gt;&lt;/STRONG&gt;} [Demand / Supply Date]))"}&amp;gt;}&lt;/P&gt;&lt;P&gt;aggr(&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(sum({$&amp;lt;Part=,[Part Number]=,Planner=, [Work Station]= P([Work Station])&amp;gt;}[Suggested Quantity]*[Cycle Time In Seconds]/Cavities/3600/$(vEfficiency)*[Calculate Hours Flag])&lt;/P&gt;&lt;P&gt;-sum({$&amp;lt;Part=,[Part Number]=,Planner=, [Work Station]= P([Work Station])&amp;gt;}[Confirmed Supply Quantity]*[Cycle Time In Seconds]/Cavities/3600/$(vEfficiency)*[Calculate Hours Flag])&lt;/P&gt;&lt;P&gt;+sum({$&amp;lt;Part=,[Part Number]=,Planner=, [Work Station]= P([Work Station])&amp;gt;}[Demand Quantity]*[Cycle Time In Seconds]/Cavities/3600/$(vEfficiency)*[Calculate Hours Flag])&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;,[Demand / Supply Date])),[Demand / Supply Date],&lt;STRONG&gt;[Part Number]&lt;/STRONG&gt;))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 May 2016 09:55:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function-and-set-analysis/m-p/1153051#M376547</guid>
      <dc:creator>chriswain2</dc:creator>
      <dc:date>2016-05-16T09:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr function and set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function-and-set-analysis/m-p/1153052#M376548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think what you might be looking for is the FirstSortedValue() function. I am not sure I understand your current expression well enough to offer any changes. but the idea is something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FirstSortedValue(FieldName, -Date)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check more about FirstSortedValue here: &lt;A href="https://community.qlik.com/docs/DOC-9044"&gt;Value Associated with Min/Max Value of Another Field (Front End Solution)&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 May 2016 10:11:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function-and-set-analysis/m-p/1153052#M376548</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-05-16T10:11:37Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr function and set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function-and-set-analysis/m-p/1153053#M376549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Sunny. I will try it and post the solution if I get it working.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 May 2016 10:15:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function-and-set-analysis/m-p/1153053#M376549</guid>
      <dc:creator>chriswain2</dc:creator>
      <dc:date>2016-05-16T10:15:20Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr function and set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function-and-set-analysis/m-p/1153054#M376550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I could not get that to work unfortunately. If I take out the max date expression and put it in a straight table with TOTAL &amp;lt;[Part Number]&amp;gt; added to it as below, it gives the result I want, but in the main expression it has no effect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;date(max({$&amp;lt;Part=,[Part Number]=, Planner=,[Work Station]=p([Work Station]) ,[Manual Supply]-={0},[Demand / Supply Date]=&amp;gt;}TOTAL &amp;lt;[Part Number]&amp;gt; [Demand / Supply Date])) &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 May 2016 10:43:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function-and-set-analysis/m-p/1153054#M376550</guid>
      <dc:creator>chriswain2</dc:creator>
      <dc:date>2016-05-16T10:43:03Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr function and set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function-and-set-analysis/m-p/1153055#M376551</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there any way you can share a sample?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-1290"&gt;Preparing examples for Upload - Reduction and Data Scrambling&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-16454"&gt;Uploading a Sample&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 May 2016 17:40:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function-and-set-analysis/m-p/1153055#M376551</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-05-16T17:40:26Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr function and set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function-and-set-analysis/m-p/1153056#M376552</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had a look at doing that but because of the fact that the data from the inputfields would disappear it would be very difficult for anyone to see what I would be trying to achieve. I have been asked to move on to other tasks as this was a nice to have rather than an essential requirement, but thanks for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 May 2016 07:51:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function-and-set-analysis/m-p/1153056#M376552</guid>
      <dc:creator>chriswain2</dc:creator>
      <dc:date>2016-05-17T07:51:52Z</dc:date>
    </item>
  </channel>
</rss>

