<?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: Grouped bar chart  percentage not working in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Grouped-bar-chart-percentage-not-working/m-p/1603005#M444476</link>
    <description>&lt;P&gt;Hi, what means '&lt;SPAN&gt;it didn't work&lt;/SPAN&gt;'? no result or no 100% result?&lt;/P&gt;&lt;P&gt;If not 100% can be ok, as Jonathan says doing a distinct count can count the same value many times in numerator but only one time in denominator.&lt;/P&gt;&lt;P&gt;If no result at all maybe it's beacause the extra parenthesys in&amp;nbsp;&lt;SPAN&gt;Vcyclicgroup, or becasue you have fixed 'GroupName' when this should be the name of the cyclic group. And better use set instead of let when declaring strings that will be used as expressions:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Set Vcyclicgroup =&amp;nbsp;GetCurrentField(&lt;EM&gt;YourRealGroupName&lt;/EM&gt;);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If field name has blank spaces or any other special character you need to add brackets:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;total &amp;lt;$(&lt;STRONG&gt;[=Vcyclicgroup]&lt;/STRONG&gt;)&amp;gt;{$&amp;lt;region&amp;nbsp; = {'america'}&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;,&lt;/FONT&gt;&lt;/STRONG&gt;&amp;gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The comma after 'america' also can cause an error, it should be removed.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 17 Jul 2019 06:34:16 GMT</pubDate>
    <dc:creator>rubenmarin</dc:creator>
    <dc:date>2019-07-17T06:34:16Z</dc:date>
    <item>
      <title>Grouped bar chart  percentage not working</title>
      <link>https://community.qlik.com/t5/QlikView/Grouped-bar-chart-percentage-not-working/m-p/1602098#M444413</link>
      <description>&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Every one i&amp;nbsp; have&amp;nbsp; a bar chart with a cyclic group plus a dimension and i have only one expression which is&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;count ( distinct&amp;nbsp; units) / count ( total&amp;nbsp; distinct&amp;nbsp; units )&amp;nbsp; and this expression is represented as&amp;nbsp; percentage . But&amp;nbsp; this&lt;/P&gt;&lt;P&gt;percentage is not summing unto 100&amp;nbsp; %. and the reason behind is&amp;nbsp; &amp;nbsp;" count ( total&amp;nbsp; distinct&amp;nbsp; units )&amp;nbsp; " is not&amp;nbsp; calculating&lt;/P&gt;&lt;P&gt;properly. When&amp;nbsp; i&amp;nbsp; changed the bar chart to straight table to find out the issue ,&amp;nbsp; the denominator value should be a sum of&lt;/P&gt;&lt;P&gt;rows but its getting expression total . So&amp;nbsp; any one can tell me on how to get sum of rows value in the denominator , i tried&lt;/P&gt;&lt;P&gt;aggr function , total &amp;lt;dimension 1, dimension 2 &amp;gt; both of them didn't work&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 03:00:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Grouped-bar-chart-percentage-not-working/m-p/1602098#M444413</guid>
      <dc:creator>Shiva123</dc:creator>
      <dc:date>2024-11-16T03:00:41Z</dc:date>
    </item>
    <item>
      <title>Re: Grouped bar chart  percentage not working</title>
      <link>https://community.qlik.com/t5/QlikView/Grouped-bar-chart-percentage-not-working/m-p/1602185#M444416</link>
      <description>&lt;P&gt;Hi, in example, for this data:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;LOAD * Inline [
dim1, dim2, val
a,d,3
a,d,2
a,d,3
b,d,2
c,e,3
]&lt;/LI-CODE&gt;&lt;P&gt;This expression seems to work:&lt;/P&gt;&lt;P&gt;count(distinct val) / sum(TOTAL aggr(count(TOTAL &amp;lt;dim1, dim2&amp;gt; distinct val), dim1, dim2))&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2019 08:36:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Grouped-bar-chart-percentage-not-working/m-p/1602185#M444416</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2019-07-15T08:36:48Z</dc:date>
    </item>
    <item>
      <title>Re: Grouped bar chart  percentage not working</title>
      <link>https://community.qlik.com/t5/QlikView/Grouped-bar-chart-percentage-not-working/m-p/1602488#M444441</link>
      <description>&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Rubenmarin thanks for your reply ,&amp;nbsp; the expression is working when there is a single dimension, but in my bar chart i have a cyclic group and i have tried to add&amp;nbsp; all the dimensions that are there&amp;nbsp; in the cyclic group to the total and aggr function for the denominator and it didn't work .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Shiva&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2019 20:41:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Grouped-bar-chart-percentage-not-working/m-p/1602488#M444441</guid>
      <dc:creator>Shiva123</dc:creator>
      <dc:date>2019-07-15T20:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: Grouped bar chart  percentage not working</title>
      <link>https://community.qlik.com/t5/QlikView/Grouped-bar-chart-percentage-not-working/m-p/1602561#M444445</link>
      <description>&lt;P&gt;Hi Shiva, you can try with:&lt;/P&gt;&lt;P&gt;count(distinct val) / sum(TOTAL aggr(count(TOTAL &amp;lt;dim1, &lt;STRONG&gt;$(=GetCurrentField(&lt;EM&gt;GroupName&lt;/EM&gt;))&lt;/STRONG&gt;&amp;gt; distinct val), dim1, &lt;STRONG&gt;$(=GetCurrentField(&lt;EM&gt;GroupName&lt;/EM&gt;))&lt;/STRONG&gt;))&lt;/P&gt;&lt;P&gt;or:&lt;/P&gt;&lt;P&gt;count(distinct val) / sum(TOTAL aggr(count(TOTAL &amp;lt;&lt;STRONG&gt;$(=GetCurrentField(&lt;EM&gt;GroupName1&lt;/EM&gt;))&lt;/STRONG&gt;, &lt;STRONG&gt;$(=GetCurrentField(&lt;EM&gt;GroupName2&lt;/EM&gt;))&lt;/STRONG&gt;&amp;gt; distinct val), &lt;STRONG&gt;$(=GetCurrentField(&lt;EM&gt;GroupName1&lt;/EM&gt;))&lt;/STRONG&gt;, &lt;STRONG&gt;$(=GetCurrentField(&lt;EM&gt;GroupName2&lt;/EM&gt;))&lt;/STRONG&gt;))&lt;/P&gt;&lt;P&gt;You need to get only the active dimensions, not all dimensions in group&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2019 07:06:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Grouped-bar-chart-percentage-not-working/m-p/1602561#M444445</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2019-07-16T07:06:53Z</dc:date>
    </item>
    <item>
      <title>Re: Grouped bar chart  percentage not working</title>
      <link>https://community.qlik.com/t5/QlikView/Grouped-bar-chart-percentage-not-working/m-p/1602940#M444470</link>
      <description>&lt;P&gt;Hi &lt;SPAN&gt;Rubenmarin&amp;nbsp;&lt;/SPAN&gt;i tried this , it didn't work . i am defining market in my expression will that be an&lt;/P&gt;&lt;P&gt;issue ,&amp;nbsp; meaning&amp;nbsp;my expression is&amp;nbsp; count( DISTINCT{$&amp;lt;region&amp;nbsp; = {'america'}&amp;gt;} units )&amp;nbsp; &amp;nbsp; &amp;nbsp;/&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;sum(total aggr( count( total &amp;lt;$(=Vcyclicgroup)&amp;gt;{$&amp;lt;region&amp;nbsp; = {'america'},&amp;gt;} distinct&lt;/P&gt;&lt;P&gt;units),$(=Vcyclicgroup))) . like this i am&amp;nbsp;defining for all the regions (&amp;nbsp; meaning creating one&lt;/P&gt;&lt;P&gt;expression for each region ).&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;let Vcyclicgroup =&amp;nbsp;&lt;STRONG&gt;GetCurrentField(&lt;EM&gt;GroupName&lt;/EM&gt;))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Shiva&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2019 00:25:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Grouped-bar-chart-percentage-not-working/m-p/1602940#M444470</guid>
      <dc:creator>Shiva123</dc:creator>
      <dc:date>2019-07-17T00:25:19Z</dc:date>
    </item>
    <item>
      <title>Re: Grouped bar chart  percentage not working</title>
      <link>https://community.qlik.com/t5/QlikView/Grouped-bar-chart-percentage-not-working/m-p/1602969#M444472</link>
      <description>&lt;P&gt;Can you attach your sample app which has the issue ??&amp;nbsp; for test purpose create a column&amp;nbsp;&amp;nbsp;1 as flag in your load and try testing your&amp;nbsp; expression&lt;/P&gt;&lt;P&gt;count ( distinct value) / sum(flag)&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2019 04:45:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Grouped-bar-chart-percentage-not-working/m-p/1602969#M444472</guid>
      <dc:creator>qliksus</dc:creator>
      <dc:date>2019-07-17T04:45:26Z</dc:date>
    </item>
    <item>
      <title>Re: Grouped bar chart  percentage not working</title>
      <link>https://community.qlik.com/t5/QlikView/Grouped-bar-chart-percentage-not-working/m-p/1602987#M444474</link>
      <description>&lt;P&gt;The value returned with a DISTINCT will be different for different dimensionality, so the expression:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;sum(distinct value) / sum(total distinct value) &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;will not normally add up to 100% -- it would normally be more than 100%. This is because values that exist in more than one dimension are counted multiple times in the sum(), but only once in the sum(total).&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2019 05:43:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Grouped-bar-chart-percentage-not-working/m-p/1602987#M444474</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2019-07-17T05:43:12Z</dc:date>
    </item>
    <item>
      <title>Re: Grouped bar chart  percentage not working</title>
      <link>https://community.qlik.com/t5/QlikView/Grouped-bar-chart-percentage-not-working/m-p/1603005#M444476</link>
      <description>&lt;P&gt;Hi, what means '&lt;SPAN&gt;it didn't work&lt;/SPAN&gt;'? no result or no 100% result?&lt;/P&gt;&lt;P&gt;If not 100% can be ok, as Jonathan says doing a distinct count can count the same value many times in numerator but only one time in denominator.&lt;/P&gt;&lt;P&gt;If no result at all maybe it's beacause the extra parenthesys in&amp;nbsp;&lt;SPAN&gt;Vcyclicgroup, or becasue you have fixed 'GroupName' when this should be the name of the cyclic group. And better use set instead of let when declaring strings that will be used as expressions:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Set Vcyclicgroup =&amp;nbsp;GetCurrentField(&lt;EM&gt;YourRealGroupName&lt;/EM&gt;);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If field name has blank spaces or any other special character you need to add brackets:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;total &amp;lt;$(&lt;STRONG&gt;[=Vcyclicgroup]&lt;/STRONG&gt;)&amp;gt;{$&amp;lt;region&amp;nbsp; = {'america'}&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;,&lt;/FONT&gt;&lt;/STRONG&gt;&amp;gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The comma after 'america' also can cause an error, it should be removed.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2019 06:34:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Grouped-bar-chart-percentage-not-working/m-p/1603005#M444476</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2019-07-17T06:34:16Z</dc:date>
    </item>
  </channel>
</rss>

