<?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 AutoNumber used for Ranking is not working for second ranking in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/AutoNumber-used-for-Ranking-is-not-working-for-second-ranking/m-p/1653666#M48836</link>
    <description>&lt;P&gt;I am trying to rank 2 separate fields in my script.&amp;nbsp; the first field is ranked perfectly, but the 2nd field is not starting at 1 like expected. &amp;nbsp; Its stating where the previous rank left off:&lt;/P&gt;&lt;DIV&gt;&lt;FONT&gt;DATA1:&lt;BR /&gt;LOAD&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RowNo()&amp;nbsp; AS Record_Key,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Outstandings,&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Commitment_Amt,&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Age_Bucket,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Segment,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Equivalent_Regulatory_Risk_Rating as ERRR&lt;BR /&gt;FROM [lib://QLIK_DataMart (dllcorp_pretete)/MISC/US_Portfolio_Quarterly_Detail.QVD] (qvd);&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;// Past Due Borrowers&lt;BR /&gt;MAP_PAST_DUE:&lt;BR /&gt;Mapping&lt;BR /&gt;LOAD Record_Key, AutoNumber(RowNo(),Segment) AS Rank_PD&lt;BR /&gt;RESIDENT DATA1&lt;BR /&gt;where Age_Bucket &amp;gt; 1&lt;BR /&gt;&amp;nbsp; and Outstandings &amp;gt; 0&lt;BR /&gt;order by Segment, Outstandings desc;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;// Watchlist&lt;BR /&gt;MAP_WATCHLIST:&lt;BR /&gt;Mapping&lt;BR /&gt;LOAD Record_Key, AutoNumber(RowNo(),Segment) AS Rank_WL&lt;BR /&gt;RESIDENT DATA1&lt;BR /&gt;where ERRR = 'Watchlist'&lt;BR /&gt;&amp;nbsp; and Outstandings &amp;gt; 0&lt;BR /&gt;order by Segment, Outstandings desc;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;&lt;BR /&gt;NoConcatenate&lt;BR /&gt;Final_Table:&lt;BR /&gt;LOAD * WHERE Rank_Past_Due&amp;nbsp; &amp;lt;= 20 or Rank_Watchlist &amp;lt;= 20;&lt;BR /&gt;Load *,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ApplyMap('MAP_PAST_DUE',Record_Key,99999)&amp;nbsp; as Rank_Past_Due,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ApplyMap('MAP_WATCHLIST',Record_Key,99999) as Rank_Watchlist,&lt;BR /&gt;Resident DATA1;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;drop table DATA1;&lt;/FONT&gt;&lt;/DIV&gt;</description>
    <pubDate>Tue, 03 Dec 2019 16:09:44 GMT</pubDate>
    <dc:creator>toddprete</dc:creator>
    <dc:date>2019-12-03T16:09:44Z</dc:date>
    <item>
      <title>AutoNumber used for Ranking is not working for second ranking</title>
      <link>https://community.qlik.com/t5/App-Development/AutoNumber-used-for-Ranking-is-not-working-for-second-ranking/m-p/1653666#M48836</link>
      <description>&lt;P&gt;I am trying to rank 2 separate fields in my script.&amp;nbsp; the first field is ranked perfectly, but the 2nd field is not starting at 1 like expected. &amp;nbsp; Its stating where the previous rank left off:&lt;/P&gt;&lt;DIV&gt;&lt;FONT&gt;DATA1:&lt;BR /&gt;LOAD&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RowNo()&amp;nbsp; AS Record_Key,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Outstandings,&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Commitment_Amt,&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Age_Bucket,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Segment,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Equivalent_Regulatory_Risk_Rating as ERRR&lt;BR /&gt;FROM [lib://QLIK_DataMart (dllcorp_pretete)/MISC/US_Portfolio_Quarterly_Detail.QVD] (qvd);&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;// Past Due Borrowers&lt;BR /&gt;MAP_PAST_DUE:&lt;BR /&gt;Mapping&lt;BR /&gt;LOAD Record_Key, AutoNumber(RowNo(),Segment) AS Rank_PD&lt;BR /&gt;RESIDENT DATA1&lt;BR /&gt;where Age_Bucket &amp;gt; 1&lt;BR /&gt;&amp;nbsp; and Outstandings &amp;gt; 0&lt;BR /&gt;order by Segment, Outstandings desc;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;// Watchlist&lt;BR /&gt;MAP_WATCHLIST:&lt;BR /&gt;Mapping&lt;BR /&gt;LOAD Record_Key, AutoNumber(RowNo(),Segment) AS Rank_WL&lt;BR /&gt;RESIDENT DATA1&lt;BR /&gt;where ERRR = 'Watchlist'&lt;BR /&gt;&amp;nbsp; and Outstandings &amp;gt; 0&lt;BR /&gt;order by Segment, Outstandings desc;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;&lt;BR /&gt;NoConcatenate&lt;BR /&gt;Final_Table:&lt;BR /&gt;LOAD * WHERE Rank_Past_Due&amp;nbsp; &amp;lt;= 20 or Rank_Watchlist &amp;lt;= 20;&lt;BR /&gt;Load *,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ApplyMap('MAP_PAST_DUE',Record_Key,99999)&amp;nbsp; as Rank_Past_Due,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ApplyMap('MAP_WATCHLIST',Record_Key,99999) as Rank_Watchlist,&lt;BR /&gt;Resident DATA1;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;drop table DATA1;&lt;/FONT&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 03 Dec 2019 16:09:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/AutoNumber-used-for-Ranking-is-not-working-for-second-ranking/m-p/1653666#M48836</guid>
      <dc:creator>toddprete</dc:creator>
      <dc:date>2019-12-03T16:09:44Z</dc:date>
    </item>
    <item>
      <title>Re: AutoNumber used for Ranking is not working for second ranking</title>
      <link>https://community.qlik.com/t5/App-Development/AutoNumber-used-for-Ranking-is-not-working-for-second-ranking/m-p/1653700#M48840</link>
      <description>What happens if you remove "segment" from your autonumber function? The second parameter is the AutoID which will tie values together across autonumbering functions so that may be whats causing your issue.&lt;BR /&gt;Function reference: &lt;A href="https://help.qlik.com/en-US/sense/November2019/Subsystems/Hub/Content/Sense_Hub/Scripting/CounterFunctions/autonumber.htm" target="_blank"&gt;https://help.qlik.com/en-US/sense/November2019/Subsystems/Hub/Content/Sense_Hub/Scripting/CounterFunctions/autonumber.htm&lt;/A&gt;</description>
      <pubDate>Tue, 03 Dec 2019 17:47:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/AutoNumber-used-for-Ranking-is-not-working-for-second-ranking/m-p/1653700#M48840</guid>
      <dc:creator>andoryuu</dc:creator>
      <dc:date>2019-12-03T17:47:49Z</dc:date>
    </item>
    <item>
      <title>Re: AutoNumber used for Ranking is not working for second ranking</title>
      <link>https://community.qlik.com/t5/App-Development/AutoNumber-used-for-Ranking-is-not-working-for-second-ranking/m-p/1653744#M48844</link>
      <description>&lt;P&gt;Thanks for the quick reply, but let me provide a few more details,&amp;nbsp; as your suggestion did not work.&lt;/P&gt;&lt;P&gt;The result set has 7 unique Segments, and I am trying to rank the Outstanding amount for all past due customers&amp;nbsp; from 1 to N within each segment.&amp;nbsp; So each segment (7 of them) should have a ranking from 1-n. &amp;nbsp; Additionally, I am trying to rank the watchlist customers by outstanding amount within each segment. &amp;nbsp; So, two sets of rankings, both ranked by outstanding amount, one for past due customers and one ranking for watchlist customers.&lt;/P&gt;&lt;P&gt;The first ranking works with no problem.&amp;nbsp; Then 2nd ranking (using basically the exact logic) does not restart the ranking at 1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Tue, 03 Dec 2019 19:17:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/AutoNumber-used-for-Ranking-is-not-working-for-second-ranking/m-p/1653744#M48844</guid>
      <dc:creator>toddprete</dc:creator>
      <dc:date>2019-12-03T19:17:55Z</dc:date>
    </item>
  </channel>
</rss>

