<?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 Dimensions in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculated-Dimensions/m-p/728776#M261160</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG alt="Histogram 2014-06-23.jpg" class="jive-image" src="/legacyfs/online/60991_Histogram 2014-06-23.jpg" style="width: 620px; height: 374px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to have a 'histogram' that works for selecting one single month, but also in case I select multiple (e.g. 2 months).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this histogram on the X-axis I want to show the 'AppUsageFrequencyCategories': 1x, 2x, 3x, 4x, 5x, 6+x for nr of times a certain App has been used. This AppUsageFrequencyCategory is dependent on AppUsage attribute which contains how many time the App is used in a specific month for a specific country etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the expression I calculate the number of devices (COUNT DISTINCT DeviceID) for which in a certain month the selected App (=ServiceID) has been 1x, 2x, 3x etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I first had the 'AppUsageFrequencyCategory' as a &lt;STRONG&gt;calculate attribute&lt;/STRONG&gt;, but I do understand now I need a &lt;STRONG&gt;Calculated Dimension&lt;/STRONG&gt; for it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Simply example of the problem why my currently defined Calculated Dimension does not seem to work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Month 20140101:&lt;/P&gt;&lt;P&gt;DeviceID, AppUsage&lt;/P&gt;&lt;P&gt;7602767 2&lt;/P&gt;&lt;P&gt;7603047 2&lt;/P&gt;&lt;P&gt;8538589 9&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Month 20140201:&lt;/P&gt;&lt;P&gt;DeviceID, AppUsage&lt;/P&gt;&lt;P&gt;7602767 1&lt;/P&gt;&lt;P&gt;8102376 2&lt;/P&gt;&lt;P&gt;8538589 13&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Month 20140101 and 20140201 (both selected):&lt;/P&gt;&lt;P&gt;DeviceID, AppUsage&lt;/P&gt;&lt;P&gt;7602767 2&lt;/P&gt;&lt;P&gt;7603047 2&lt;/P&gt;&lt;P&gt;8102376 2&lt;/P&gt;&lt;P&gt;8538589 9&lt;/P&gt;&lt;P&gt;8538589 13&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Month 20140101 and 20140201 (both selected):&lt;/P&gt;&lt;P&gt;DeviceID, AppUsage&lt;/P&gt;&lt;P&gt;7602767 3 (1+2)&lt;/P&gt;&lt;P&gt;7603047 2&lt;/P&gt;&lt;P&gt;8102376 2&lt;/P&gt;&lt;P&gt;8538589 22 (9+13)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And because "I get" (see above) is not what "I need", the histogram will count the number of Unique Devices wrongly as it does a count distinct devices within the AppUsageFrequency Categories. I see that I have some double counting if in the first month the App Usage for a unique Device is in a different 'category' then in the second month etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My Calculated Dimension is the following:&lt;/P&gt;&lt;P&gt;=IF(AppUsage=1,'1x',IF(AppUsage=2,'2x',IF(AppUsage=3,'3x',IF(AppUsage=4,'4x',IF(AppUsage=5,'5x','6+')))))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that I need to do the SUM or AGGR over the selection (e.g. the two months) so that a DeviceID that uses that App e.g. 1x in Month 1 and 1x in Month 2 is calculated as '2x' and not as '1x'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Before I had the following line as a calculated attribute in my table (which work if I select only one month):&lt;/P&gt;&lt;P&gt;IF(AppUsage=1,'1x',IF(AppUsage=2,'2x',IF(AppUsage=3,'3x',IF(AppUsage=4,'4x',IF(AppUsage=5,'5x','6+')))))&amp;nbsp; AS AppUsageFreqCategory&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestion?&lt;/P&gt;&lt;P&gt;If needed I can provide the source code, or a picture of the current QV model I have.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.S. I have already read "HIC" article about Calculated Dimensions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Jun 2014 12:40:13 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-06-23T12:40:13Z</dc:date>
    <item>
      <title>Calculated Dimensions</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-Dimensions/m-p/728776#M261160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG alt="Histogram 2014-06-23.jpg" class="jive-image" src="/legacyfs/online/60991_Histogram 2014-06-23.jpg" style="width: 620px; height: 374px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to have a 'histogram' that works for selecting one single month, but also in case I select multiple (e.g. 2 months).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this histogram on the X-axis I want to show the 'AppUsageFrequencyCategories': 1x, 2x, 3x, 4x, 5x, 6+x for nr of times a certain App has been used. This AppUsageFrequencyCategory is dependent on AppUsage attribute which contains how many time the App is used in a specific month for a specific country etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the expression I calculate the number of devices (COUNT DISTINCT DeviceID) for which in a certain month the selected App (=ServiceID) has been 1x, 2x, 3x etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I first had the 'AppUsageFrequencyCategory' as a &lt;STRONG&gt;calculate attribute&lt;/STRONG&gt;, but I do understand now I need a &lt;STRONG&gt;Calculated Dimension&lt;/STRONG&gt; for it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Simply example of the problem why my currently defined Calculated Dimension does not seem to work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Month 20140101:&lt;/P&gt;&lt;P&gt;DeviceID, AppUsage&lt;/P&gt;&lt;P&gt;7602767 2&lt;/P&gt;&lt;P&gt;7603047 2&lt;/P&gt;&lt;P&gt;8538589 9&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Month 20140201:&lt;/P&gt;&lt;P&gt;DeviceID, AppUsage&lt;/P&gt;&lt;P&gt;7602767 1&lt;/P&gt;&lt;P&gt;8102376 2&lt;/P&gt;&lt;P&gt;8538589 13&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Month 20140101 and 20140201 (both selected):&lt;/P&gt;&lt;P&gt;DeviceID, AppUsage&lt;/P&gt;&lt;P&gt;7602767 2&lt;/P&gt;&lt;P&gt;7603047 2&lt;/P&gt;&lt;P&gt;8102376 2&lt;/P&gt;&lt;P&gt;8538589 9&lt;/P&gt;&lt;P&gt;8538589 13&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Month 20140101 and 20140201 (both selected):&lt;/P&gt;&lt;P&gt;DeviceID, AppUsage&lt;/P&gt;&lt;P&gt;7602767 3 (1+2)&lt;/P&gt;&lt;P&gt;7603047 2&lt;/P&gt;&lt;P&gt;8102376 2&lt;/P&gt;&lt;P&gt;8538589 22 (9+13)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And because "I get" (see above) is not what "I need", the histogram will count the number of Unique Devices wrongly as it does a count distinct devices within the AppUsageFrequency Categories. I see that I have some double counting if in the first month the App Usage for a unique Device is in a different 'category' then in the second month etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My Calculated Dimension is the following:&lt;/P&gt;&lt;P&gt;=IF(AppUsage=1,'1x',IF(AppUsage=2,'2x',IF(AppUsage=3,'3x',IF(AppUsage=4,'4x',IF(AppUsage=5,'5x','6+')))))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that I need to do the SUM or AGGR over the selection (e.g. the two months) so that a DeviceID that uses that App e.g. 1x in Month 1 and 1x in Month 2 is calculated as '2x' and not as '1x'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Before I had the following line as a calculated attribute in my table (which work if I select only one month):&lt;/P&gt;&lt;P&gt;IF(AppUsage=1,'1x',IF(AppUsage=2,'2x',IF(AppUsage=3,'3x',IF(AppUsage=4,'4x',IF(AppUsage=5,'5x','6+')))))&amp;nbsp; AS AppUsageFreqCategory&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestion?&lt;/P&gt;&lt;P&gt;If needed I can provide the source code, or a picture of the current QV model I have.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.S. I have already read "HIC" article about Calculated Dimensions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jun 2014 12:40:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-Dimensions/m-p/728776#M261160</guid>
      <dc:creator />
      <dc:date>2014-06-23T12:40:13Z</dc:date>
    </item>
  </channel>
</rss>

