<?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 Dimension based on another dimension in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Dimension-based-on-another-dimension/m-p/1222333#M390661</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am having a challenge trying to figure this out for a dimension value. I am working on a inventory report, where we need to list the primary supplier for each material. Some materials might have 2 or 3 different suppliers, so they just want the supplier that sold the most in the year to be displayed. I was able to achieve that by using FirstSortedValue function, based on total quantity purchased for the year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem I am facing now, is that some materials are not used as often, and they are purchased every 2 or 3 months. So, as I am pulling the suppliers based the total quantity purchased on the year, in January and February I am getting a lot of nulls. So, they asked I can use the previous year primary supplier if the current year primary supplier is NULL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I need to create a statement, with a condition that says, if primary supplier (which is defaulted for current year) is null, give me primary supplier from last year. This could easily be accomplished with set analysis if it was a measure, but I have never done it for a dimension.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Find an example below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How it is now&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-image image-1" height="172" src="https://community.qlik.com/legacyfs/online/152189_pastedImage_1.png" style="width: 279px; height: 171.802px;" width="279" /&gt;&lt;/P&gt;&lt;P&gt;How it is supposed to be&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-image image-2" height="166" src="https://community.qlik.com/legacyfs/online/152190_pastedImage_2.png" style="width: 306px; height: 166.231px;" width="306" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LD&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 Feb 2017 17:31:20 GMT</pubDate>
    <dc:creator>luizcdepaula</dc:creator>
    <dc:date>2017-02-06T17:31:20Z</dc:date>
    <item>
      <title>Dimension based on another dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Dimension-based-on-another-dimension/m-p/1222333#M390661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am having a challenge trying to figure this out for a dimension value. I am working on a inventory report, where we need to list the primary supplier for each material. Some materials might have 2 or 3 different suppliers, so they just want the supplier that sold the most in the year to be displayed. I was able to achieve that by using FirstSortedValue function, based on total quantity purchased for the year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem I am facing now, is that some materials are not used as often, and they are purchased every 2 or 3 months. So, as I am pulling the suppliers based the total quantity purchased on the year, in January and February I am getting a lot of nulls. So, they asked I can use the previous year primary supplier if the current year primary supplier is NULL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I need to create a statement, with a condition that says, if primary supplier (which is defaulted for current year) is null, give me primary supplier from last year. This could easily be accomplished with set analysis if it was a measure, but I have never done it for a dimension.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Find an example below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How it is now&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-image image-1" height="172" src="https://community.qlik.com/legacyfs/online/152189_pastedImage_1.png" style="width: 279px; height: 171.802px;" width="279" /&gt;&lt;/P&gt;&lt;P&gt;How it is supposed to be&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-image image-2" height="166" src="https://community.qlik.com/legacyfs/online/152190_pastedImage_2.png" style="width: 306px; height: 166.231px;" width="306" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LD&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Feb 2017 17:31:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dimension-based-on-another-dimension/m-p/1222333#M390661</guid>
      <dc:creator>luizcdepaula</dc:creator>
      <dc:date>2017-02-06T17:31:20Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension based on another dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Dimension-based-on-another-dimension/m-p/1222334#M390662</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is your expression? right now? Assuming is it Count([Primary Supplier]), try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If(Len(Trim(&lt;SPAN style="font-size: 13.3333px;"&gt;Count([Primary Supplier])&lt;/SPAN&gt;)) &amp;gt; 0, &lt;SPAN style="font-size: 13.3333px;"&gt;Count([Primary Supplier])&lt;/SPAN&gt;, &lt;SPAN style="font-size: 13.3333px;"&gt;Count(TOTAL &amp;lt;Material, Supplier&amp;gt;[Primary Supplier])&lt;/SPAN&gt;)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Feb 2017 17:42:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dimension-based-on-another-dimension/m-p/1222334#M390662</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-02-06T17:42:22Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension based on another dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Dimension-based-on-another-dimension/m-p/1222335#M390663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My expression is for a dimension, not a measure. The Primary Supplier number is not the count of suppliers, but their IDs. So, for instance, in my example, 4 is the Supplier number 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To achieve Primary Supplier, this is what I use&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FirstSortedValue([Vendor ID],-TotalQty) as [Primary Supplier];&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Group by Material,Year;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The expression I am using to get last year Primary Supplier if current year is NULL is below, but it is not working.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if(isnull([Primary Supplier]),(if(Year=year(today())-1,{Primary Supplier])),[Primary Supplier])&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-image image-1" height="203" src="https://community.qlik.com/legacyfs/online/152202_pastedImage_1.png" style="width: 357px; height: 203.093px;" width="357" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Feb 2017 19:05:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dimension-based-on-another-dimension/m-p/1222335#M390663</guid>
      <dc:creator>luizcdepaula</dc:creator>
      <dc:date>2017-02-06T19:05:06Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension based on another dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Dimension-based-on-another-dimension/m-p/1222336#M390664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Aggr(If(IsNull([Primary Supplier]), Above(&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;[Primary Supplier]&lt;/STRONG&gt;), [Primary Supplier]), Supplier, Year)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Feb 2017 19:10:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dimension-based-on-another-dimension/m-p/1222336#M390664</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-02-06T19:10:27Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension based on another dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Dimension-based-on-another-dimension/m-p/1222337#M390665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The statement above did not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to impose a condition, like in a set analysis, to give [Primary Supplier] for Year 2016?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, for a measure I would simply use Count({&amp;lt;Year=year(today())-1&amp;gt;}[Primary Vendor]). Is there a way to make a dimension (Primary Supplier) dependent on another dimension (Year)?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Feb 2017 19:35:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dimension-based-on-another-dimension/m-p/1222337#M390665</guid>
      <dc:creator>luizcdepaula</dc:creator>
      <dc:date>2017-02-06T19:35:05Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension based on another dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Dimension-based-on-another-dimension/m-p/1222338#M390666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think so because Year is one of the dimension in your chart. Either you have to use Above or you can create an AsOfTable -&amp;gt; &lt;A href="https://community.qlik.com/qlik-blogpost/4531"&gt;The As-Of Table&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Feb 2017 19:41:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dimension-based-on-another-dimension/m-p/1222338#M390666</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-02-06T19:41:40Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension based on another dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Dimension-based-on-another-dimension/m-p/1222339#M390667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG __jive_id="152216" alt="" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/152216_pastedImage_0.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-GB" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN lang="EN-GB" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN lang="EN-GB" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="EN-GB" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;if&lt;/SPAN&gt;&lt;SPAN lang="EN-GB" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="EN-GB" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;IsNull&lt;/SPAN&gt;&lt;SPAN lang="EN-GB" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="EN-GB" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;[Primary Suplier]&lt;/SPAN&gt;&lt;SPAN lang="EN-GB" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;), &lt;/SPAN&gt;&lt;SPAN lang="EN-GB" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN lang="EN-GB" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="EN-GB" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;nodistinct&lt;/SPAN&gt; &lt;SPAN lang="EN-GB" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;FirstSortedValue&lt;/SPAN&gt;&lt;SPAN lang="EN-GB" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN lang="EN-GB" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;[Primary Suplier]&lt;/SPAN&gt;&lt;SPAN lang="EN-GB" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;={&lt;/SPAN&gt;&lt;SPAN lang="EN-GB" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;"*"&lt;/SPAN&gt;&lt;SPAN lang="EN-GB" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;}&amp;gt;} &lt;/SPAN&gt;&lt;SPAN lang="EN-GB" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;[Primary Suplier]&lt;/SPAN&gt;&lt;SPAN lang="EN-GB" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;, -&lt;/SPAN&gt;&lt;SPAN lang="EN-GB" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;Year&lt;/SPAN&gt;&lt;SPAN lang="EN-GB" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;), &lt;/SPAN&gt;&lt;SPAN lang="EN-GB" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;Material&lt;/SPAN&gt;&lt;SPAN lang="EN-GB" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;,&lt;/SPAN&gt;&lt;SPAN lang="EN-GB" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;Suplier&lt;/SPAN&gt;&lt;SPAN lang="EN-GB" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;), &lt;/SPAN&gt;&lt;SPAN lang="EN-GB" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;[Primary Suplier]&lt;/SPAN&gt;&lt;SPAN lang="EN-GB" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;), &lt;/SPAN&gt;&lt;SPAN lang="EN-GB" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;Material&lt;/SPAN&gt;&lt;SPAN lang="EN-GB" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;,&lt;/SPAN&gt;&lt;SPAN lang="EN-GB" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;Suplier&lt;/SPAN&gt;&lt;SPAN lang="EN-GB" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;,&lt;/SPAN&gt;&lt;SPAN lang="EN-GB" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;Year&lt;/SPAN&gt;&lt;SPAN lang="EN-GB" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-GB" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-GB" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-GB" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;IMG __jive_id="152217" alt="" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/152217_pastedImage_2.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Feb 2017 20:31:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dimension-based-on-another-dimension/m-p/1222339#M390667</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-02-06T20:31:18Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension based on another dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Dimension-based-on-another-dimension/m-p/1222340#M390668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Luiz, does my solution solve your problem or rather did you understand the approach?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Feb 2017 05:48:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dimension-based-on-another-dimension/m-p/1222340#M390668</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-02-08T05:48:30Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension based on another dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Dimension-based-on-another-dimension/m-p/1222341#M390669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Try this .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SALES:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; year, material, supplier, qty&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2016, AAA, 1, 10&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2016, AAA, 2, 8&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2016, BB, 3, 7&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2016, BB, 4, 15&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2017, AAA, 1, 15&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2017, AAA, 2, 10&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2017, BB, 3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2017, BB, 4&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MAXQTYSUPPLIER:&lt;/P&gt;&lt;P&gt;LEFT JOIN &lt;/P&gt;&lt;P&gt;LOAD year,material,MAX(qty) AS qty,'MAX' AS FILTER Resident SALES&amp;nbsp; GROUP BY year,material;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;left join &lt;/P&gt;&lt;P&gt;LOAD year,material,supplier as maxsupplier Resident SALES where FILTER='MAX' ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mapping :&lt;/P&gt;&lt;P&gt;mapping load year&amp;amp;material,maxsupplier Resident SALES ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;load * ,if(isnull(applymap('mapping',year&amp;amp;material,null())),applymap('mapping',year-1&amp;amp;material,null()),applymap('mapping',year&amp;amp;material,null())) as Supplier1 Resident SALES ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;take this in table box and omit rows where supplier1 is null .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Anjee&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Feb 2017 06:32:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dimension-based-on-another-dimension/m-p/1222341#M390669</guid>
      <dc:creator>veeranj</dc:creator>
      <dc:date>2017-02-08T06:32:08Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension based on another dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Dimension-based-on-another-dimension/m-p/1222342#M390670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robin, thanks for the effort. It did not work, as it was not giving me top supplier for previous year. Veeranjaneyulu reply below, worked. I just had to adjust to my data model and it worked perfectly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LD&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Feb 2017 15:01:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dimension-based-on-another-dimension/m-p/1222342#M390670</guid>
      <dc:creator>luizcdepaula</dc:creator>
      <dc:date>2017-02-08T15:01:09Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension based on another dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Dimension-based-on-another-dimension/m-p/1222343#M390671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Veeranjaneyulu.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was able to fix it, or at least make it work with a similar solution, by creating another table, with previous year top suppliers, and then changing the year to current year, and calling it Primary_Supplier_PY. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I do like your approach, using the the applymap function, as it works for previous years too, without having to create different tables for each year. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Great work!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LD&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Feb 2017 15:06:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dimension-based-on-another-dimension/m-p/1222343#M390671</guid>
      <dc:creator>luizcdepaula</dc:creator>
      <dc:date>2017-02-08T15:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension based on another dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Dimension-based-on-another-dimension/m-p/1222344#M390672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;basically this should work, but I think it is not worth trying any further, because you have a working solution...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Feb 2017 18:17:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dimension-based-on-another-dimension/m-p/1222344#M390672</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-02-08T18:17:57Z</dc:date>
    </item>
  </channel>
</rss>

