<?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: Rank function in set analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Rank-function-in-set-analysis/m-p/1509068#M600242</link>
    <description>&lt;P&gt;What exactly do you mean when you say cut data by period? Would you be able to elaborate on this using an example?&lt;/P&gt;</description>
    <pubDate>Mon, 19 Nov 2018 13:11:01 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2018-11-19T13:11:01Z</dc:date>
    <item>
      <title>Rank function in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-function-in-set-analysis/m-p/1509043#M600238</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a request to add straight&amp;nbsp;tables with Top Items, it should be dynamical. Client want to have a possibility to switch between different measures and change numbers of top items. For this I use following calculation:&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;[Item Code]= {"=rank(SUM([PO Quantity]), 4)&amp;lt;= $(vTop)"}&amp;gt;} [PO Quantity])&lt;/P&gt;&lt;P&gt;It shows Top Item Codes by PO Quantity and works fine with all data.&lt;/P&gt;&lt;P&gt;In the same time I have periods in my application - MTD, QTD, YTD and I need to show top items by different periods, so my formula should looks like:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Sum({&amp;lt;&lt;STRONG&gt;$($1)&lt;/STRONG&gt;, [Item Code]= {"=rank(SUM(&lt;STRONG&gt;{&amp;lt;$($1)&amp;gt;}&lt;/STRONG&gt; [PO Quantity]), 4)&amp;lt;= $(vTop)"}&amp;gt;} [PO Quantity])&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;where $($1) it's my period ex.: $(ePO_Quanity(YTD))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For some reason it doesn't work and I get null value instead of data.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Do you have any ideas about this issue?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Vitalii&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 05:12:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-function-in-set-analysis/m-p/1509043#M600238</guid>
      <dc:creator>vitaliichupryna</dc:creator>
      <dc:date>2024-11-16T05:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: Rank function in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-function-in-set-analysis/m-p/1509048#M600239</link>
      <description>&lt;P&gt;Seems like you are using variables with parameters... try this&lt;/P&gt;&lt;PRE&gt;Sum({&amp;lt;$1, [Item Code] = {"=Rank(Sum({&amp;lt;$1&amp;gt;} [PO Quantity]), 4) &amp;lt;= $(vTop)"}&amp;gt;} [PO Quantity])&lt;/PRE&gt;</description>
      <pubDate>Mon, 19 Nov 2018 12:48:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-function-in-set-analysis/m-p/1509048#M600239</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-11-19T12:48:16Z</dc:date>
    </item>
    <item>
      <title>Re: Rank function in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-function-in-set-analysis/m-p/1509049#M600240</link>
      <description>&lt;P&gt;Hi Vitali,&lt;/P&gt;&lt;P&gt;Please remember to post questions related to the product in the correct discussion board.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the list of discussion board for qlik products,&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.qlik.com/t5/Qlik-Products/ct-p/qlik-products" target="_blank"&gt;https://community.qlik.com/t5/Qlik-Products/ct-p/qlik-products&lt;/A&gt;&lt;/P&gt;&lt;P&gt;This post will be moved to the correct discussion board soon.&lt;/P&gt;&lt;P&gt;Thanks,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Pablo&lt;/P&gt;</description>
      <pubDate>Mon, 19 Nov 2018 12:48:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-function-in-set-analysis/m-p/1509049#M600240</guid>
      <dc:creator>pablolabbe</dc:creator>
      <dc:date>2018-11-19T12:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: Rank function in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-function-in-set-analysis/m-p/1509065#M600241</link>
      <description>&lt;P&gt;Sunny,&lt;/P&gt;&lt;P&gt;It shows data, but doesn't cut data by Period&lt;/P&gt;</description>
      <pubDate>Mon, 19 Nov 2018 13:04:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-function-in-set-analysis/m-p/1509065#M600241</guid>
      <dc:creator>vitaliichupryna</dc:creator>
      <dc:date>2018-11-19T13:04:57Z</dc:date>
    </item>
    <item>
      <title>Re: Rank function in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-function-in-set-analysis/m-p/1509068#M600242</link>
      <description>&lt;P&gt;What exactly do you mean when you say cut data by period? Would you be able to elaborate on this using an example?&lt;/P&gt;</description>
      <pubDate>Mon, 19 Nov 2018 13:11:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-function-in-set-analysis/m-p/1509068#M600242</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-11-19T13:11:01Z</dc:date>
    </item>
    <item>
      <title>Re: Rank function in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-function-in-set-analysis/m-p/1509094#M600243</link>
      <description>&lt;P&gt;I mean that period is my Data range and I have variables with period,QTD:&lt;/P&gt;&lt;P&gt;Year=, Month=, Quarter=, [Date]=, DayOfQuarter = {"&amp;lt;=$(=Max(DayOfQuarter))"},QuarterIndex = {"$(=Max(QuarterIndex))"}&lt;/P&gt;&lt;P&gt;So, I expect to see top 10 or top 7 from this data range, and for this reason I use parameters $($1) with Period&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vitalii&lt;/P&gt;</description>
      <pubDate>Mon, 19 Nov 2018 13:45:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-function-in-set-analysis/m-p/1509094#M600243</guid>
      <dc:creator>vitaliichupryna</dc:creator>
      <dc:date>2018-11-19T13:45:35Z</dc:date>
    </item>
    <item>
      <title>Re: Rank function in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-function-in-set-analysis/m-p/1509102#M600244</link>
      <description>&lt;P&gt;So, the YTD/QTD in the above examples are not field but some sort of expressions which include commas in them... unfortunately variable with parameters won't be able to handle this.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Nov 2018 13:50:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-function-in-set-analysis/m-p/1509102#M600244</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-11-19T13:50:28Z</dc:date>
    </item>
    <item>
      <title>Re: Rank function in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-function-in-set-analysis/m-p/1509126#M600245</link>
      <description>&lt;P&gt;Yes, it doesn't work.&lt;/P&gt;&lt;P&gt;I decided to use following approach - select top items in the calculated dimension:&lt;/P&gt;&lt;P&gt;=Aggr(if(rank($(ePO_Quantity($(vPeriod))), 4)&amp;lt;=vTop ,[Item Code]), [Item Code])&lt;/P&gt;</description>
      <pubDate>Mon, 19 Nov 2018 14:09:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-function-in-set-analysis/m-p/1509126#M600245</guid>
      <dc:creator>vitaliichupryna</dc:creator>
      <dc:date>2018-11-19T14:09:55Z</dc:date>
    </item>
    <item>
      <title>Re: Rank function in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-function-in-set-analysis/m-p/1509140#M600246</link>
      <description>&lt;P&gt;I think your original approach may well work&lt;/P&gt;&lt;P&gt;In the attached, I have variables&lt;/P&gt;&lt;P&gt;vSales = SUM({$&amp;lt;$(=$1)&amp;gt;} Sales)&lt;/P&gt;&lt;P&gt;YTD = Year={2018}, Date={"&amp;gt;=01/01/2018"}&lt;/P&gt;&lt;P&gt;QTD = Year={2018}, Date={"&amp;gt;=01/10/2018"}&lt;/P&gt;&lt;P&gt;MTD = Year={2018}, Date={"&amp;gt;=01/11/2018"}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am now able to define expressions such as $(vSales(YTD)), $(vSales(QTD)),&amp;nbsp;$(vSales(MTD)), and these work just fine.&lt;/P&gt;&lt;P&gt;In your example this would be equivalent to&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;$(=$1), [Item Code]= {"=rank(SUM({&amp;lt;$(=$1)&amp;gt;} [PO Quantity]), 4)&amp;lt;= $(vTop)"}&amp;gt;} [PO Quantity])&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Nov 2018 14:37:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-function-in-set-analysis/m-p/1509140#M600246</guid>
      <dc:creator>marcus_malinow</dc:creator>
      <dc:date>2018-11-19T14:37:35Z</dc:date>
    </item>
  </channel>
</rss>

