<?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: Strange problem creating new grouping table based off of resident table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Strange-problem-creating-new-grouping-table-based-off-of/m-p/417802#M486539</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So I realized how to solve this.&lt;/P&gt;&lt;P&gt;As I said the original query in the load script was correct. The problem was that I needed the query to be dynamic and update based upon the dimensions choosen.&lt;/P&gt;&lt;P&gt;Here is what I did to solve the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the dimesnsion of my chart I used the following formula:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=aggr(&lt;/P&gt;&lt;P&gt;if(sum(sdk_syncs) &amp;lt;= 50000,'0-50K',&lt;/P&gt;&lt;P&gt;if(sum(sdk_syncs) &amp;gt; 50000 and sum( sdk_syncs) &amp;lt;=200000,'50K - 200K',&lt;/P&gt;&lt;P&gt;if(sum(sdk_syncs) &amp;gt; 200000 and sum(sdk_syncs) &amp;lt;=500000,'200K - 500K',&lt;/P&gt;&lt;P&gt;if(sum(sdk_syncs) &amp;gt; 500000 and sum(sdk_syncs) &amp;lt;=1000000,'500K - 1M',&lt;/P&gt;&lt;P&gt;if(sum(sdk_syncs) &amp;gt; 1000000,'&amp;gt; 1M','blank'&lt;/P&gt;&lt;P&gt;))))),&lt;/P&gt;&lt;P&gt;application_key&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then as an expression I used a count distinct of the application_key.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Apr 2013 07:26:46 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-04-10T07:26:46Z</dc:date>
    <item>
      <title>Strange problem creating new grouping table based off of resident table</title>
      <link>https://community.qlik.com/t5/QlikView/Strange-problem-creating-new-grouping-table-based-off-of/m-p/417801#M486538</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #575757; background-color: #ffffff;"&gt;Hi,&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #575757; background-color: #ffffff;"&gt;I wrote the following query in my load script:&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #575757; background-color: #ffffff;"&gt;l&lt;SPAN style="font-family: inherit;"&gt;&lt;EM&gt;oad&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #575757; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: inherit;"&gt;&lt;EM&gt;if(sum(sdk_syncs) &amp;lt;= 50000,'5 - 0-50K',&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #575757; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: inherit;"&gt;&lt;EM&gt;if(sum(sdk_syncs) &amp;gt; 50000 and sum( sdk_syncs) &amp;lt;=200000,'4 - 50K - 200K',&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #575757; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: inherit;"&gt;&lt;EM&gt;if(sum(sdk_syncs) &amp;gt; 200000 and sum(sdk_syncs) &amp;lt;=500000,'3 - 200K - 500K',&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #575757; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: inherit;"&gt;&lt;EM&gt;if(sum(sdk_syncs) &amp;gt; 500000 and sum(sdk_syncs) &amp;lt;=1000000,'2 - 500K - 1M',&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #575757; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: inherit;"&gt;&lt;EM&gt;if(sum(sdk_syncs) &amp;gt; 1000000,'1 - &amp;gt; 1M','blank'&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #575757; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: inherit;"&gt;&lt;EM&gt;))))) as Grp,application_key,sum(sdk_syncs) as sum_syncs&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #575757; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: inherit;"&gt;&lt;EM&gt;resident sdk_ar_data&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #575757; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: inherit;"&gt;&lt;EM&gt;group by application_key;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #575757; background-color: #ffffff;"&gt;that dumps data from a resident table into buckets based upon a sum of X (sdk_syncs). When I work with all the data I have - the answers match my source database 100%. When I start using a date dimension, the sum number (sum_syncs) is not correct (at least in certain instances).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #575757; background-color: #ffffff;"&gt;Some additional info. So I understand what the problem is - but I am not sure how to fix it.&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #575757; background-color: #ffffff;"&gt;So the problem is that this query is correct - but for the entire date range - let's say 2011-2013. However, if I look at 2011 I still see the sum_syncs for the entire date range. When I add a date key, I introduce a diffeent problem - namely that the data is not grouped correctly at all and a single application can fall into multiple grps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #575757; background-color: #ffffff;"&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #575757; background-color: #ffffff;"&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Apr 2013 11:42:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Strange-problem-creating-new-grouping-table-based-off-of/m-p/417801#M486538</guid>
      <dc:creator />
      <dc:date>2013-04-03T11:42:48Z</dc:date>
    </item>
    <item>
      <title>Re: Strange problem creating new grouping table based off of resident table</title>
      <link>https://community.qlik.com/t5/QlikView/Strange-problem-creating-new-grouping-table-based-off-of/m-p/417802#M486539</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So I realized how to solve this.&lt;/P&gt;&lt;P&gt;As I said the original query in the load script was correct. The problem was that I needed the query to be dynamic and update based upon the dimensions choosen.&lt;/P&gt;&lt;P&gt;Here is what I did to solve the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the dimesnsion of my chart I used the following formula:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=aggr(&lt;/P&gt;&lt;P&gt;if(sum(sdk_syncs) &amp;lt;= 50000,'0-50K',&lt;/P&gt;&lt;P&gt;if(sum(sdk_syncs) &amp;gt; 50000 and sum( sdk_syncs) &amp;lt;=200000,'50K - 200K',&lt;/P&gt;&lt;P&gt;if(sum(sdk_syncs) &amp;gt; 200000 and sum(sdk_syncs) &amp;lt;=500000,'200K - 500K',&lt;/P&gt;&lt;P&gt;if(sum(sdk_syncs) &amp;gt; 500000 and sum(sdk_syncs) &amp;lt;=1000000,'500K - 1M',&lt;/P&gt;&lt;P&gt;if(sum(sdk_syncs) &amp;gt; 1000000,'&amp;gt; 1M','blank'&lt;/P&gt;&lt;P&gt;))))),&lt;/P&gt;&lt;P&gt;application_key&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then as an expression I used a count distinct of the application_key.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Apr 2013 07:26:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Strange-problem-creating-new-grouping-table-based-off-of/m-p/417802#M486539</guid>
      <dc:creator />
      <dc:date>2013-04-10T07:26:46Z</dc:date>
    </item>
  </channel>
</rss>

