<?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: Calculated Dimension using Count Distinct by Vendor in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculated-Dimension-using-Count-Distinct-by-Vendor/m-p/890733#M310318</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure about faster, but at least looks cleaner.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 May 2015 19:51:38 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-05-06T19:51:38Z</dc:date>
    <item>
      <title>Calculated Dimension using Count Distinct by Vendor</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-Dimension-using-Count-Distinct-by-Vendor/m-p/890725#M310310</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'm trying to define a dimension that will group the # of POs per vendor as shown below.&lt;/P&gt;&lt;P&gt;&amp;lt;10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10-100&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 100-200&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 200-500&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;gt;500&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the following that works correctly as an expression to get the # per vendor:&lt;/P&gt;&lt;P&gt;=Count((($&amp;lt;[Vendor ID]&amp;gt;} distinct PO)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I added that to IF statements in the calculated dimension as follows, but keep getting an error message returned.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="a.jpg" class="jive-image image-1" height="119" src="https://community.qlik.com/legacyfs/online/85828_a.jpg" width="734" /&gt;&lt;/P&gt;&lt;P&gt;If I put the above into a text box, &amp;gt;500 is displayed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone know what I'm missing in the dimension?&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;P&gt;-P&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2015 17:50:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-Dimension-using-Count-Distinct-by-Vendor/m-p/890725#M310310</guid>
      <dc:creator />
      <dc:date>2015-05-06T17:50:17Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Dimension using Count Distinct by Vendor</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-Dimension-using-Count-Distinct-by-Vendor/m-p/890726#M310311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try to replace each&lt;/P&gt;&lt;P&gt;count({&amp;lt;[Vendor ID]&amp;gt;} distinct PO)&lt;/P&gt;&lt;P&gt;with this&lt;/P&gt;&lt;P&gt;aggr(count(distinct PO),[Vendor ID])&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2015 19:01:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-Dimension-using-Count-Distinct-by-Vendor/m-p/890726#M310311</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-06T19:01:48Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Dimension using Count Distinct by Vendor</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-Dimension-using-Count-Distinct-by-Vendor/m-p/890727#M310312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I recommend doing this at script level, or you might be able to use class function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="syntax"&gt;&lt;A name="kanchor412"&gt;&lt;/A&gt;&lt;A name="class"&gt;&lt;/A&gt;&lt;SPAN class="Bold"&gt;class(&lt;/SPAN&gt;&lt;SPAN class="Italic"&gt;expression, interval [ , label [ , offset ]]&lt;/SPAN&gt;&lt;SPAN class="Bold"&gt;)&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;Creates a classification of &lt;SPAN class="Italic"&gt;expressions&lt;/SPAN&gt;. The bin width is determined by the number set as &lt;SPAN class="Italic"&gt;interval&lt;/SPAN&gt;. The result is shown as a&amp;lt;=x&amp;lt;b, where a and b are the upper and lower limits of the bin. The x can be replaced by an arbitrary string stated in &lt;SPAN class="Italic"&gt;label&lt;/SPAN&gt;. 0 is normally the default starting point of the classification. This can be changed by adding an &lt;SPAN class="Italic"&gt;offset&lt;/SPAN&gt;. &lt;/P&gt;&lt;P class="example"&gt;Examples:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;class( var,10 )&lt;/SPAN&gt; with &lt;SPAN class="Italic"&gt;var&lt;/SPAN&gt; = 23 returns &lt;SPAN class="Italic"&gt;'20&amp;lt;=x&amp;lt;30'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;class( var,5,'value' )&lt;/SPAN&gt; with &lt;SPAN class="Italic"&gt;var&lt;/SPAN&gt; = 23 returns &lt;SPAN class="Italic"&gt;'20&amp;lt;= value &amp;lt;25'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;class( var,10,'x',5 )&lt;/SPAN&gt; with &lt;SPAN class="Italic"&gt;var&lt;/SPAN&gt; = 23 returns &lt;SPAN class="Italic"&gt;'15&amp;lt;=x&amp;lt;25'&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2015 19:03:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-Dimension-using-Count-Distinct-by-Vendor/m-p/890727#M310312</guid>
      <dc:creator>ramoncova06</dc:creator>
      <dc:date>2015-05-06T19:03:19Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Dimension using Count Distinct by Vendor</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-Dimension-using-Count-Distinct-by-Vendor/m-p/890728#M310313</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My first thought was the class() function, but the nature of intervals in this case doesn't help.&lt;/P&gt;&lt;P&gt;Script level solution is a better idea.&amp;nbsp; If the buckets are permanent, selections-independent, it will work fine and improve performance.&amp;nbsp; But if the result must depend on selections, then it can't be done in the script.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2015 19:13:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-Dimension-using-Count-Distinct-by-Vendor/m-p/890728#M310313</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-06T19:13:08Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Dimension using Count Distinct by Vendor</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-Dimension-using-Count-Distinct-by-Vendor/m-p/890729#M310314</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Agreed, I really just wanted to give some options besides having some nested IF's &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2015 19:19:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-Dimension-using-Count-Distinct-by-Vendor/m-p/890729#M310314</guid>
      <dc:creator>ramoncova06</dc:creator>
      <dc:date>2015-05-06T19:19:58Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Dimension using Count Distinct by Vendor</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-Dimension-using-Count-Distinct-by-Vendor/m-p/890730#M310315</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much for the quick responses!&amp;nbsp; I was able to resolved the issue using the Aggr function on the PO as suggested by Michael.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I couldn't do it via script as the values will change depending on the user filter selections.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2015 19:25:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-Dimension-using-Count-Distinct-by-Vendor/m-p/890730#M310315</guid>
      <dc:creator />
      <dc:date>2015-05-06T19:25:13Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Dimension using Count Distinct by Vendor</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-Dimension-using-Count-Distinct-by-Vendor/m-p/890731#M310316</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nobody likes nested IF &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/laugh.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think that it should work even if have only one "external" aggr instead of many "internal":&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;aggr(&lt;/P&gt;&lt;P&gt;if(count(distinct PO)&amp;lt;10,'&amp;lt;10',&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;,[Vendor ID])&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2015 19:33:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-Dimension-using-Count-Distinct-by-Vendor/m-p/890731#M310316</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-06T19:33:04Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Dimension using Count Distinct by Vendor</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-Dimension-using-Count-Distinct-by-Vendor/m-p/890732#M310317</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I like nested IF &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/wink.png" /&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using Aggr "external" worked as well.&amp;nbsp; Does this method process faster than "internal", or just for ease of understanding/structure?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2015 19:48:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-Dimension-using-Count-Distinct-by-Vendor/m-p/890732#M310317</guid>
      <dc:creator />
      <dc:date>2015-05-06T19:48:12Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Dimension using Count Distinct by Vendor</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-Dimension-using-Count-Distinct-by-Vendor/m-p/890733#M310318</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure about faster, but at least looks cleaner.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2015 19:51:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-Dimension-using-Count-Distinct-by-Vendor/m-p/890733#M310318</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-06T19:51:38Z</dc:date>
    </item>
  </channel>
</rss>

