<?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: Error in the calculated dimension (Histogram) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Error-in-the-calculated-dimension-Histogram/m-p/111707#M752500</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No, you put the grouping logic inside the aggr and around the current outer if(...)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 Nov 2018 10:56:23 GMT</pubDate>
    <dc:creator>Gysbert_Wassenaar</dc:creator>
    <dc:date>2018-11-08T10:56:23Z</dc:date>
    <item>
      <title>Error in the calculated dimension (Histogram)</title>
      <link>https://community.qlik.com/t5/QlikView/Error-in-the-calculated-dimension-Histogram/m-p/111700#M752493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good afternoon guys!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to make a histogram, counting differently the codes that I have that reach a percentage value (accuracy).&lt;/P&gt;&lt;P&gt;Each code has a percentage value, but sometimes more than one code has the same value.&lt;/P&gt;&lt;P&gt;This formula for accuracy is used in other graphs and works perfectly, as follows:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;= if (sum (Demand) = sum (Forecast), 1,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if (sum (Demand) = 0 and sum (Forecast) &amp;lt;&amp;gt; 0, 0,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if (sum (Forecast) = 0 and sum (Demand) &amp;lt;&amp;gt; 0, 0,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if (sum (Demand)&amp;gt; sum (Forecast), Round (1+ Fabs (sum (Demand) - sum (Forecast)) / sum (Forecast), 0.1)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if (sum (Forecast)&amp;gt; sum (Demand), Round (sum (Demand) / sum (Forecast), 0.1)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;)))))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Expression, I would like you to have the code count corresponding to that percentage. The expression would be:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;= count (distinct [Code&amp;amp;Loc])&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I would like to have is something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="ex - Copy.png" class="jive-image image-1" src="/legacyfs/online/217623_ex - Copy.png" style="height: 312px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What actually happens in the chart is a "// Error in the calculated dimension"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone tell me where I'm going wrong?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-in-the-calculated-dimension-Histogram/m-p/111700#M752493</guid>
      <dc:creator>paulinhok14</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Error in the calculated dimension (Histogram)</title>
      <link>https://community.qlik.com/t5/QlikView/Error-in-the-calculated-dimension-Histogram/m-p/111701#M752494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your expression if(sum .... etc ...) needs to be calculated over a set of one or more dimensions if you want to create a calculated for your histogram. You need to use the aggr function for that:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;= Aggr( &lt;/STRONG&gt;if (sum (Demand) = sum (Forecast), 1,&lt;/P&gt;&lt;P&gt;if (sum (Demand) = 0 and sum (Forecast) &amp;lt;&amp;gt; 0, 0,&lt;/P&gt;&lt;P&gt;if (sum (Forecast) = 0 and sum (Demand) &amp;lt;&amp;gt; 0, 0,&lt;/P&gt;&lt;P&gt;if (sum (Demand)&amp;gt; sum (Forecast), Round (1+ Fabs (sum (Demand) - sum (Forecast)) / sum (Forecast), 0.1)&lt;/P&gt;&lt;P&gt;if (sum (Forecast)&amp;gt; sum (Demand), Round (sum (Demand) / sum (Forecast), 0.1)&lt;/P&gt;&lt;P&gt;)))))&lt;STRONG&gt;, Dim1, Dim2, ..., DimN)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Replace Dim1, Dim2, ..., DimN with the dimensions over which the sums need to be calculated&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Nov 2018 12:36:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-in-the-calculated-dimension-Histogram/m-p/111701#M752494</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2018-11-06T12:36:27Z</dc:date>
    </item>
    <item>
      <title>Re: Error in the calculated dimension (Histogram)</title>
      <link>https://community.qlik.com/t5/QlikView/Error-in-the-calculated-dimension-Histogram/m-p/111702#M752495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Gysbert thank you, it works perfectly!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Only for understanding purposes, why do I need to do this if the relation of my expression with the dimension is 1 to 1?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Nov 2018 15:51:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-in-the-calculated-dimension-Histogram/m-p/111702#M752495</guid>
      <dc:creator>paulinhok14</dc:creator>
      <dc:date>2018-11-06T15:51:54Z</dc:date>
    </item>
    <item>
      <title>Re: Error in the calculated dimension (Histogram)</title>
      <link>https://community.qlik.com/t5/QlikView/Error-in-the-calculated-dimension-Histogram/m-p/111703#M752496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And how is Qlikview to know that unless you tell it what that dimension is? Any field in your document could be the dimension over which the expression should be aggregated. How does sum(Demand) tell Qlikview which dimension it should use to calculate the results?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Nov 2018 08:50:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-in-the-calculated-dimension-Histogram/m-p/111703#M752496</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2018-11-07T08:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: Error in the calculated dimension (Histogram)</title>
      <link>https://community.qlik.com/t5/QlikView/Error-in-the-calculated-dimension-Histogram/m-p/111704#M752497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, if my expression is count ([Code&amp;amp;Loc]), it is supposed to aggregate into these counts, isn't it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I want to display the data aggregated as intervals now, how can I do it if my dimension is already aggregated?&lt;/P&gt;&lt;P&gt;For example if I want to put it like: a count of how many codes have the accuracity between 0 and 75%, 75% and 125%, above 125...&lt;/P&gt;&lt;P&gt;In this case the class function won't work because the step is not fixed, this can't be solved with Aggr expression?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Nov 2018 16:45:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-in-the-calculated-dimension-Histogram/m-p/111704#M752497</guid>
      <dc:creator>paulinhok14</dc:creator>
      <dc:date>2018-11-07T16:45:19Z</dc:date>
    </item>
    <item>
      <title>Re: Error in the calculated dimension (Histogram)</title>
      <link>https://community.qlik.com/t5/QlikView/Error-in-the-calculated-dimension-Histogram/m-p/111705#M752498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;Well, if my expression is count ([Code&amp;amp;Loc]), it is supposed to aggregate into these counts, isn't it?&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;No, it is suppose to count how many combinations of Code&amp;amp;Loc exist per ...something. That could be countries or product groups or age classes or whatever. Never per Code&amp;amp;Loc because that is always 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;If I want to display the data aggregated as intervals now, how can I do it if my dimension is already aggregated?&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Which &lt;EM&gt;already aggregated&lt;/EM&gt; dimension are we talking about now? The calculated dimension with the aggr I posted above? You can group that however you want. You could use nested if statements to create the intervals you need.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Nov 2018 07:26:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-in-the-calculated-dimension-Histogram/m-p/111705#M752498</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2018-11-08T07:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: Error in the calculated dimension (Histogram)</title>
      <link>https://community.qlik.com/t5/QlikView/Error-in-the-calculated-dimension-Histogram/m-p/111706#M752499</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;No, it is suppose to count how many combinations of Code&amp;amp;Loc exist per ...something. That could be countries or product groups or age classes or whatever. Never per Code&amp;amp;Loc because that is always 1.&lt;/SPAN&gt;&lt;/P&gt;

&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Ok got it, I thought my calculated dimension was already agreggating by [Code&amp;amp;Loc]...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Which &lt;/SPAN&gt;&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;already aggregated&lt;/EM&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt; dimension are we talking about now? The calculated dimension with the aggr I posted above? You can group that however you want. You could use nested if statements to create the intervals you need.&lt;/SPAN&gt;&lt;/P&gt;

&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Yes, the same we discussed above, my chart worked perfectly using the Aggr by the field that my expression is counting, as you well told me:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;= Aggr (&lt;/STRONG&gt;if ( sum (Demand) = sum (Forecast), 100,&lt;/P&gt;&lt;P&gt;if ( sum (Demand) = 0 and sum (Forecast) &amp;lt;&amp;gt; 0, 0,&lt;/P&gt;&lt;P&gt;if ( sum (Forecast) = 0 and sum (Demand) &amp;lt;&amp;gt; 0, 0,&lt;/P&gt;&lt;P&gt;if ( sum (Demand) &amp;gt; sum (Forecast), Round (&amp;nbsp; (1+ Fabs (sum (Demand) - sum (Forecast) ) / sum (Forecast) ) *100&amp;nbsp; , 0.1),&lt;/P&gt;&lt;P&gt;if ( sum (Forecast) &amp;gt; sum (Demand),&amp;nbsp; Round (&amp;nbsp; ( sum (Demand) / sum (Forecast) ) *100 , 0.1)&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;)&lt;STRONG&gt;, [Code&amp;amp;Loc])&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now the thing is, if this dimension is already aggregated on [Code&amp;amp;Loc], how can I aggregate it on new nonexistent field?&lt;/P&gt;&lt;P&gt;I mean: &lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt; if I want to put it like: a count of how many codes have the accuracity (my whole dimension above means accuracity) between 0 and 75, 75 and 125, above 125...&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;There is no field called Accuracity, so I can't just do it like : if (Accuracity &amp;gt; 75, etc....)&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;In order to nest ifs, I would need to Aggr it again?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Nov 2018 10:52:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-in-the-calculated-dimension-Histogram/m-p/111706#M752499</guid>
      <dc:creator>paulinhok14</dc:creator>
      <dc:date>2018-11-08T10:52:26Z</dc:date>
    </item>
    <item>
      <title>Re: Error in the calculated dimension (Histogram)</title>
      <link>https://community.qlik.com/t5/QlikView/Error-in-the-calculated-dimension-Histogram/m-p/111707#M752500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No, you put the grouping logic inside the aggr and around the current outer if(...)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Nov 2018 10:56:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-in-the-calculated-dimension-Histogram/m-p/111707#M752500</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2018-11-08T10:56:23Z</dc:date>
    </item>
  </channel>
</rss>

