<?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 Calculated Dimension with a Messy Aggr() in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculated-Dimension-with-a-Messy-Aggr/m-p/158377#M502747</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As can be the case with posting new topics, I think I figured it out shortly after posting.&lt;/P&gt;&lt;P&gt;Something like this:&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;If(StartRange = 30, count(distinct total if(Aggr($(=vSA), Customer) &amp;gt;= 30, Customer)),&lt;BR /&gt;If(StartRange = 20, count(distinct total if(Aggr($(=vSA), Customer) &amp;gt;= 20&lt;BR /&gt; and Aggr($(=vSA), Customer) &amp;lt; 30, Customer)),&lt;BR /&gt;If(StartRange = 10, count(distinct total if(Aggr($(=vSA), Customer) &amp;gt;= 10&lt;BR /&gt; and Aggr($(=vSA), Customer) &amp;lt; 20, Customer)),&lt;BR /&gt;If(StartRange = 0, count(distinct total if(Aggr($(=vSA), Customer) &amp;gt;= 0&lt;BR /&gt; and Aggr($(=vSA), Customer) &amp;lt; 10, Customer))))))&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Aug 2010 16:20:59 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-08-12T16:20:59Z</dc:date>
    <item>
      <title>Calculated Dimension with a Messy Aggr()</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-Dimension-with-a-Messy-Aggr/m-p/158376#M502746</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to use an Aggr() and Calculated Dimension to group users based on different ranges. The expression used to count the metrics is pretty big. I am able to get the calculated dimension and everything working except I can't force QlikView to show all dimensions when there are no matches. In this example, I have Customers and each Customer has various FKs. I'm trying to give FKs points and then count the number of Customers that fit into different ranges.&lt;/P&gt;&lt;P&gt;This is an example of what I'm using for the Calculated Dimension:&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;=If(Aggr($(=vSA), Customer) &amp;gt;= 30, '30',&lt;BR /&gt;If(Aggr($(=vSA), Customer) &amp;gt;= 20, '20',&lt;BR /&gt;If(Aggr($(=vSA), Customer) &amp;gt;= 10, '10',&lt;BR /&gt;If(Aggr($(=vSA), Customer) &amp;gt;= 0, '0'))))&lt;/PRE&gt;Then I use a simple expression: &lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;Count(distinct Customer)&lt;/PRE&gt;That setup works fine, except that when no customers fit into a certain range, it doesn't appear. I've tried Show All Dimensions and even making a dummy expression that should show for all. The dollar sign expansion uses a variable with a complicated Count. For the example, I used something like: &lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;Count(distinct FK) * 5&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;On another topic, I saw some suggestions to create the dimensions in the load, so I did that, but I can't get anything to work in that situation. I've tried a few different things, but I can't seem to use the range dimension to count the Customers I want. I've attached an example that illustrates my problem, but the real application is significantly more complicated. I ran into the same issues when creating this sample as I have in my real app, so if I can solve it in the sample, it should apply to the full version. I can't calculate any of these values in the load, because the user needs to select a date range that would change the counts. Any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Aug 2010 15:47:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-Dimension-with-a-Messy-Aggr/m-p/158376#M502746</guid>
      <dc:creator />
      <dc:date>2010-08-12T15:47:12Z</dc:date>
    </item>
    <item>
      <title>Calculated Dimension with a Messy Aggr()</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-Dimension-with-a-Messy-Aggr/m-p/158377#M502747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As can be the case with posting new topics, I think I figured it out shortly after posting.&lt;/P&gt;&lt;P&gt;Something like this:&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;If(StartRange = 30, count(distinct total if(Aggr($(=vSA), Customer) &amp;gt;= 30, Customer)),&lt;BR /&gt;If(StartRange = 20, count(distinct total if(Aggr($(=vSA), Customer) &amp;gt;= 20&lt;BR /&gt; and Aggr($(=vSA), Customer) &amp;lt; 30, Customer)),&lt;BR /&gt;If(StartRange = 10, count(distinct total if(Aggr($(=vSA), Customer) &amp;gt;= 10&lt;BR /&gt; and Aggr($(=vSA), Customer) &amp;lt; 20, Customer)),&lt;BR /&gt;If(StartRange = 0, count(distinct total if(Aggr($(=vSA), Customer) &amp;gt;= 0&lt;BR /&gt; and Aggr($(=vSA), Customer) &amp;lt; 10, Customer))))))&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Aug 2010 16:20:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-Dimension-with-a-Messy-Aggr/m-p/158377#M502747</guid>
      <dc:creator />
      <dc:date>2010-08-12T16:20:59Z</dc:date>
    </item>
  </channel>
</rss>

