<?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 Rank on multiple dynamic ad-hoc dimensions in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Rank-on-multiple-dynamic-ad-hoc-dimensions/m-p/117205#M18054</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an inline table that is defined as the following for my first selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RankOrganizationalDimensions:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; @RankOrgNum, @RankOrgDesc, @RankOrgDisplay&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; 01, Company,&amp;nbsp; 'Company'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; 02, Group, GroupName&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; 03, Division, DivisionName&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; 04, Market, MarketName&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; 05, Facility, FacilityName&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My second selection is dynamic:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ESLDimensions:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;@PLRankNum, @PLRankDesc&lt;/P&gt;&lt;P&gt;01, Level 1, $(vPLLevel1)&lt;/P&gt;&lt;P&gt;02, Inpatient Med/Surg, IPMedSurg&lt;/P&gt;&lt;P&gt;03, Level 2, $(vPLLevel2)&lt;/P&gt;&lt;P&gt;04, Level 3, $(vPLLevel3)&lt;/P&gt;&lt;P&gt;05, Level 4, $(vPLLevel4)&lt;/P&gt;&lt;P&gt;06, Level 5, $(vPLLevel5)&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With the variable defined as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET vPLLevel1 = "=@PL_Level1";&lt;/P&gt;&lt;P&gt;SET vPLLevel2 = "=@PL_Level2";&lt;/P&gt;&lt;P&gt;SET vPLLevel3 = "=@PL_Level3";&lt;/P&gt;&lt;P&gt;SET vPLLevel4 = "=@PL_Level4";&lt;/P&gt;&lt;P&gt;SET vPLLevel5 = "=@PL_Level5";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a straight table with the following condition&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GetSelectedCount(@RankOrgDesc) &amp;gt; 0&lt;/P&gt;&lt;P&gt;AND&lt;/P&gt;&lt;P&gt;GetSelectedCount(@PLRankDesc) &amp;gt; 0&lt;/P&gt;&lt;P&gt;AND&lt;/P&gt;&lt;P&gt;(GetSelectedCount(@VarFixAdHocMetric) &amp;gt; 0 OR GetSelectedCount(@DirIndAdHocMetric) &amp;gt; 0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With each dimension in the table with a condition as =SubStringCount(Concat(@RankOrgNum,'|'),'02') - for the example of Group.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This creates an ad-hoc like report, but there are three levels of selections and I want to add a rank option to a single expression at a time.&amp;nbsp; =SubStringCount(Concat(@AdHocMetricNum,'|'),'001') would be the example of getting Volume.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, when I add a rank with the same @RankOrgNum conditional and ranking on the metric name i.e.&amp;nbsp; Rank([Volume]) it will only rank at the first level.&amp;nbsp; How can I get this to rank the @RankOrgDesc level by @PLRankDesc .&amp;nbsp; The number of dimensions selected with typically be 2, but it could and will be more than 2 a times.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The closest I came is adding each metric's expression in a field @PLRankCalc then calling rank like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where vRank = =@PLRankCalc&lt;/P&gt;&lt;P&gt;=MaxString({&amp;lt;@RankOrgDesc = {'&amp;amp;CHR(34)&amp;amp;'=RANK('&amp;amp;'$'&amp;amp;'(vRank),4)=1'&amp;amp;CHR(34)&amp;amp;'}&amp;gt;}&lt;SPAN style="font-size: 13.3333px;"&gt;@RankOrgDesc&lt;/SPAN&gt;)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Sep 2018 20:28:50 GMT</pubDate>
    <dc:creator>NickHoff</dc:creator>
    <dc:date>2018-09-27T20:28:50Z</dc:date>
    <item>
      <title>Rank on multiple dynamic ad-hoc dimensions</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-on-multiple-dynamic-ad-hoc-dimensions/m-p/117205#M18054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an inline table that is defined as the following for my first selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RankOrganizationalDimensions:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; @RankOrgNum, @RankOrgDesc, @RankOrgDisplay&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; 01, Company,&amp;nbsp; 'Company'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; 02, Group, GroupName&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; 03, Division, DivisionName&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; 04, Market, MarketName&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; 05, Facility, FacilityName&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My second selection is dynamic:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ESLDimensions:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;@PLRankNum, @PLRankDesc&lt;/P&gt;&lt;P&gt;01, Level 1, $(vPLLevel1)&lt;/P&gt;&lt;P&gt;02, Inpatient Med/Surg, IPMedSurg&lt;/P&gt;&lt;P&gt;03, Level 2, $(vPLLevel2)&lt;/P&gt;&lt;P&gt;04, Level 3, $(vPLLevel3)&lt;/P&gt;&lt;P&gt;05, Level 4, $(vPLLevel4)&lt;/P&gt;&lt;P&gt;06, Level 5, $(vPLLevel5)&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With the variable defined as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET vPLLevel1 = "=@PL_Level1";&lt;/P&gt;&lt;P&gt;SET vPLLevel2 = "=@PL_Level2";&lt;/P&gt;&lt;P&gt;SET vPLLevel3 = "=@PL_Level3";&lt;/P&gt;&lt;P&gt;SET vPLLevel4 = "=@PL_Level4";&lt;/P&gt;&lt;P&gt;SET vPLLevel5 = "=@PL_Level5";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a straight table with the following condition&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GetSelectedCount(@RankOrgDesc) &amp;gt; 0&lt;/P&gt;&lt;P&gt;AND&lt;/P&gt;&lt;P&gt;GetSelectedCount(@PLRankDesc) &amp;gt; 0&lt;/P&gt;&lt;P&gt;AND&lt;/P&gt;&lt;P&gt;(GetSelectedCount(@VarFixAdHocMetric) &amp;gt; 0 OR GetSelectedCount(@DirIndAdHocMetric) &amp;gt; 0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With each dimension in the table with a condition as =SubStringCount(Concat(@RankOrgNum,'|'),'02') - for the example of Group.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This creates an ad-hoc like report, but there are three levels of selections and I want to add a rank option to a single expression at a time.&amp;nbsp; =SubStringCount(Concat(@AdHocMetricNum,'|'),'001') would be the example of getting Volume.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, when I add a rank with the same @RankOrgNum conditional and ranking on the metric name i.e.&amp;nbsp; Rank([Volume]) it will only rank at the first level.&amp;nbsp; How can I get this to rank the @RankOrgDesc level by @PLRankDesc .&amp;nbsp; The number of dimensions selected with typically be 2, but it could and will be more than 2 a times.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The closest I came is adding each metric's expression in a field @PLRankCalc then calling rank like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where vRank = =@PLRankCalc&lt;/P&gt;&lt;P&gt;=MaxString({&amp;lt;@RankOrgDesc = {'&amp;amp;CHR(34)&amp;amp;'=RANK('&amp;amp;'$'&amp;amp;'(vRank),4)=1'&amp;amp;CHR(34)&amp;amp;'}&amp;gt;}&lt;SPAN style="font-size: 13.3333px;"&gt;@RankOrgDesc&lt;/SPAN&gt;)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Sep 2018 20:28:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-on-multiple-dynamic-ad-hoc-dimensions/m-p/117205#M18054</guid>
      <dc:creator>NickHoff</dc:creator>
      <dc:date>2018-09-27T20:28:50Z</dc:date>
    </item>
  </channel>
</rss>

