<?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 Creating Rankings in Load Script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Creating-Rankings-in-Load-Script/m-p/946546#M325993</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was hoping the Community would be able to help me address the following issue:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to generate a ranking for each individual via script, so that his/her ranking withing his role (aka #3 in Sales, or #3 in Management, etc).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Given 3 main fields - EMP_ID, ROLE, SCORE.&lt;/P&gt;&lt;P&gt;I would like to create a rank within the ROLE for each employee (EMP_ID), based on SCORE, so that each ROLE has its own ranking.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using set analysis, I was actually able to accomplish something close to what I need. Works well when the user is an Admin and has access to the entire dataset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, entitlements are in place to limit each user access to only the information relevant to their own ID. Therefore, from my Admin point of view I can see John Smith as #22 of 115 in Sales. John Smith, however, currently sees that he is #1 of 1 in Sales, as the rest of the dataset is not available to him.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to have the #22 (in this case) to be associated with every row for John Smith, so that, regardless of his access, I can show that he is ranked number 22 in his ROLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much in advance. And please let me know if you would like me to elaborate some more.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 Dec 2015 17:23:12 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-12-03T17:23:12Z</dc:date>
    <item>
      <title>Creating Rankings in Load Script</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-Rankings-in-Load-Script/m-p/946546#M325993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was hoping the Community would be able to help me address the following issue:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to generate a ranking for each individual via script, so that his/her ranking withing his role (aka #3 in Sales, or #3 in Management, etc).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Given 3 main fields - EMP_ID, ROLE, SCORE.&lt;/P&gt;&lt;P&gt;I would like to create a rank within the ROLE for each employee (EMP_ID), based on SCORE, so that each ROLE has its own ranking.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using set analysis, I was actually able to accomplish something close to what I need. Works well when the user is an Admin and has access to the entire dataset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, entitlements are in place to limit each user access to only the information relevant to their own ID. Therefore, from my Admin point of view I can see John Smith as #22 of 115 in Sales. John Smith, however, currently sees that he is #1 of 1 in Sales, as the rest of the dataset is not available to him.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to have the #22 (in this case) to be associated with every row for John Smith, so that, regardless of his access, I can show that he is ranked number 22 in his ROLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much in advance. And please let me know if you would like me to elaborate some more.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Dec 2015 17:23:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-Rankings-in-Load-Script/m-p/946546#M325993</guid>
      <dc:creator />
      <dc:date>2015-12-03T17:23:12Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Rankings in Load Script</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-Rankings-in-Load-Script/m-p/946547#M325994</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INPUT:&lt;/P&gt;&lt;P&gt;LOAD EMP_ID, ROLE, SCORE&lt;/P&gt;&lt;P&gt;FROM YourSourceTable;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RESULT:&lt;/P&gt;&lt;P&gt;LOAD EMP_ID, ROLE, SCORE, Autonumber(recno() , ROLE) as RANK&lt;/P&gt;&lt;P&gt;RESIDENT INPUT&lt;/P&gt;&lt;P&gt;ORDER BY ROLE, SCORE desc;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP TABLE INPUT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edit:&lt;/P&gt;&lt;P&gt;If your source system for YourSourceTable supports ORDER BY clause, you can also do it in one LOAD statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Dec 2015 18:06:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-Rankings-in-Load-Script/m-p/946547#M325994</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2015-12-03T18:06:10Z</dc:date>
    </item>
  </channel>
</rss>

