<?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: How to find max in Column A and keep value from Column B for that maximum in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/How-to-find-max-in-Column-A-and-keep-value-from-Column-B-for/m-p/1986145#M81459</link>
    <description>&lt;P&gt;Simple solution here would be as a additional measure:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;FirstSortedValue(STATUS,-WEEK)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Important the minus before the week to have the most current status.&lt;BR /&gt;More information about the function here: &lt;BR /&gt;&lt;A href="https://help.qlik.com/en-US/sense/August2022/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/BasicAggregationFunctions/firstsortedvalue.htm?tr=de-DE" target="_self"&gt;Help | firstsortedvalue&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Depending on how the data model otherwise looks, you should also take the year into account.&lt;/P&gt;</description>
    <pubDate>Tue, 27 Sep 2022 16:36:39 GMT</pubDate>
    <dc:creator>eike_s</dc:creator>
    <dc:date>2022-09-27T16:36:39Z</dc:date>
    <item>
      <title>How to find max in Column A and keep value from Column B for that maximum</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-find-max-in-Column-A-and-keep-value-from-Column-B-for/m-p/1986135#M81458</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I need help regarding following question:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How to find &lt;STRONG&gt;max&amp;nbsp; for KEY&lt;/STRONG&gt; in &lt;STRONG&gt;column Week&lt;/STRONG&gt; and keep the value from &lt;STRONG&gt;column Status&lt;/STRONG&gt; for that maximum?&lt;/P&gt;
&lt;P&gt;So my table looks like this:&lt;/P&gt;
&lt;TABLE width="330"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="110"&gt;&lt;STRONG&gt;KEY&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD width="110"&gt;&lt;STRONG&gt;WEEK&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD width="110"&gt;&lt;STRONG&gt;STATUS&lt;/STRONG&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;Passed&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;TD&gt;Rejected&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;TD&gt;In process&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;TD&gt;4&lt;/TD&gt;
&lt;TD&gt;Rejected&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;TD&gt;5&lt;/TD&gt;
&lt;TD&gt;In process&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;TD&gt;6&lt;/TD&gt;
&lt;TD&gt;Passed&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;TD&gt;7&lt;/TD&gt;
&lt;TD&gt;In process&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;TD&gt;8&lt;/TD&gt;
&lt;TD&gt;Rejected&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;TD&gt;9&lt;/TD&gt;
&lt;TD&gt;Passed&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and the result should look like:&lt;/P&gt;
&lt;TABLE width="330"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="110"&gt;&lt;STRONG&gt;KEY&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD width="110"&gt;&lt;STRONG&gt;MAX(WEEK)&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD width="110"&gt;&lt;STRONG&gt;STATUS&lt;/STRONG&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;TD&gt;In process&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;TD&gt;6&lt;/TD&gt;
&lt;TD&gt;Passed&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;TD&gt;9&lt;/TD&gt;
&lt;TD&gt;Passed&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2022 16:04:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-find-max-in-Column-A-and-keep-value-from-Column-B-for/m-p/1986135#M81458</guid>
      <dc:creator>Lazar1</dc:creator>
      <dc:date>2022-09-27T16:04:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to find max in Column A and keep value from Column B for that maximum</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-find-max-in-Column-A-and-keep-value-from-Column-B-for/m-p/1986145#M81459</link>
      <description>&lt;P&gt;Simple solution here would be as a additional measure:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;FirstSortedValue(STATUS,-WEEK)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Important the minus before the week to have the most current status.&lt;BR /&gt;More information about the function here: &lt;BR /&gt;&lt;A href="https://help.qlik.com/en-US/sense/August2022/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/BasicAggregationFunctions/firstsortedvalue.htm?tr=de-DE" target="_self"&gt;Help | firstsortedvalue&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Depending on how the data model otherwise looks, you should also take the year into account.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2022 16:36:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-find-max-in-Column-A-and-keep-value-from-Column-B-for/m-p/1986145#M81459</guid>
      <dc:creator>eike_s</dc:creator>
      <dc:date>2022-09-27T16:36:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to find max in Column A and keep value from Column B for that maximum</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-find-max-in-Column-A-and-keep-value-from-Column-B-for/m-p/1986150#M81460</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/200011"&gt;@Lazar1&lt;/a&gt;&amp;nbsp;you can achieve this using group by, Join and max function.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;key:&lt;BR /&gt;LOAD&lt;BR /&gt;KEY,&lt;BR /&gt;"WEEK",&lt;BR /&gt;STATUS&lt;BR /&gt;FROM [lib://DataFiles/Task_Lookup.xlsx]&lt;BR /&gt;(ooxml, embedded labels, table is Sheet3);&lt;/P&gt;
&lt;P&gt;right Join &lt;BR /&gt;Load&lt;/P&gt;
&lt;P&gt;max ("WEEK") as "WEEK"&lt;BR /&gt;Resident key&lt;BR /&gt;Group by KEY&lt;BR /&gt;;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2022-09-27 at 10.15.50 PM.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/90047i929F81271A84065E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2022-09-27 at 10.15.50 PM.png" alt="Screenshot 2022-09-27 at 10.15.50 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; Try to learn more about the functionalities about each function to understand the results obtained.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanx and please accept it as a solution to help other community members.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2022 16:47:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-find-max-in-Column-A-and-keep-value-from-Column-B-for/m-p/1986150#M81460</guid>
      <dc:creator>deepanshuSh</dc:creator>
      <dc:date>2022-09-27T16:47:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to find max in Column A and keep value from Column B for that maximum</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-find-max-in-Column-A-and-keep-value-from-Column-B-for/m-p/1988022#M81655</link>
      <description>&lt;P&gt;Somehow this doesn't work in my model. Even if I rename all the fields and do these lines of code as a separate script basically.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Lazar1_0-1664786423924.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/90400i8A3CC8BCB500EE01/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Lazar1_0-1664786423924.png" alt="Lazar1_0-1664786423924.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I create a new application with dummy data like the ones in the example table, I get good results.&lt;/P&gt;
&lt;P&gt;I am not sure what is the problem here.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2022 08:40:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-find-max-in-Column-A-and-keep-value-from-Column-B-for/m-p/1988022#M81655</guid>
      <dc:creator>Lazar1</dc:creator>
      <dc:date>2022-10-03T08:40:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to find max in Column A and keep value from Column B for that maximum</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-find-max-in-Column-A-and-keep-value-from-Column-B-for/m-p/1988767#M81716</link>
      <description>&lt;P&gt;Can you share the sample data, and what might be the error that you are facing?&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2022 16:17:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-find-max-in-Column-A-and-keep-value-from-Column-B-for/m-p/1988767#M81716</guid>
      <dc:creator>deepanshuSh</dc:creator>
      <dc:date>2022-10-04T16:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to find max in Column A and keep value from Column B for that maximum</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-find-max-in-Column-A-and-keep-value-from-Column-B-for/m-p/1988989#M81733</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;The script is as follows:&lt;/P&gt;
&lt;P&gt;Temp1:&lt;/P&gt;
&lt;P&gt;LOAD&lt;BR /&gt;KeyNew as KeyMaxStatus,&lt;BR /&gt;Week as WeekMaxStatus,&lt;BR /&gt;"Last status on CTGF-NEW" as MaxStatus&lt;/P&gt;
&lt;P&gt;Resident OverdueFilesAll;&lt;/P&gt;
&lt;P&gt;right join &lt;BR /&gt;Load&lt;BR /&gt;max (WeekMaxStatus) as WeekMaxStatus&lt;BR /&gt;Resident Temp1&lt;BR /&gt;Group by KeyMaxStatus;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The model looks like (&lt;EM&gt;only its really Temp1 not Temp2, that was old printscreen&lt;/EM&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Lazar1_0-1664956577360.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/90602i1DD68D696ED8A398/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Lazar1_0-1664956577360.png" alt="Lazar1_0-1664956577360.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;And the results:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Lazar1_1-1664956685572.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/90603iF2754EBD4D3627A2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Lazar1_1-1664956685572.png" alt="Lazar1_1-1664956685572.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good statuses are found, but they are presented for each week in history.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2022 08:04:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-find-max-in-Column-A-and-keep-value-from-Column-B-for/m-p/1988989#M81733</guid>
      <dc:creator>Lazar1</dc:creator>
      <dc:date>2022-10-05T08:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to find max in Column A and keep value from Column B for that maximum</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-find-max-in-Column-A-and-keep-value-from-Column-B-for/m-p/1989214#M81755</link>
      <description>&lt;P&gt;The history would be found as there would be multiple key values for the same weeks, so you need to do grouping by both key and week as well, to get the desired result based on my inference from above screenshot.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2022 16:18:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-find-max-in-Column-A-and-keep-value-from-Column-B-for/m-p/1989214#M81755</guid>
      <dc:creator>deepanshuSh</dc:creator>
      <dc:date>2022-10-05T16:18:48Z</dc:date>
    </item>
  </channel>
</rss>

