<?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: Show zero values in bar chart in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Show-zero-values-in-bar-chart/m-p/1672758#M50932</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;It is not working for me, If you have a sample QVF that is working can u attach the file&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;</description>
    <pubDate>Thu, 06 Feb 2020 04:28:23 GMT</pubDate>
    <dc:creator>Kashyap_R</dc:creator>
    <dc:date>2020-02-06T04:28:23Z</dc:date>
    <item>
      <title>Show zero values in bar chart</title>
      <link>https://community.qlik.com/t5/App-Development/Show-zero-values-in-bar-chart/m-p/1672594#M50913</link>
      <description>&lt;DIV class="c-message_kit__blocks c-message_kit__blocks--rich_text"&gt;&lt;DIV class="c-message__message_blocks c-message__message_blocks--rich_text"&gt;&lt;DIV class="p-block_kit_renderer"&gt;&lt;DIV class="p-block_kit_renderer__block_wrapper p-block_kit_renderer__block_wrapper--first"&gt;&lt;DIV class="p-rich_text_block"&gt;&lt;DIV class="p-rich_text_section"&gt;Hi all, I have the chart shown in the attachment. It is a count of all people in a population with dimensions as Age Group and Gender and a width measure written as an expression based on a count of people by gender. The sheet the chart is on allows for picking health conditions (say, Pregnancy or Depression or Cancer). Some of those conditions have no people in the age range so the chart smushes down and rather than 5 bars with zero values shows 3 or 4 bars. I would like to always show 5 bars and if no one is in the age range then the bar is zero length. I can't seem to find out how to do this. Note: this is Qlik Sense Enterprise and the age range is a column in our "person table". So in the table is, literally, 0-18 or 19-34 or 35-49 (etc.) depending on the person's age.&lt;/DIV&gt;&lt;DIV class="p-rich_text_section"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="p-rich_text_section"&gt;&lt;SPAN&gt;The current definition of the width of the bars is:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="p-rich_text_section"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="p-rich_text_section"&gt;&lt;SPAN&gt;if (person_sex = 'M', count(distinct {&amp;lt;sex = {'M'}&amp;gt;}id)*-1, count(distinct{&amp;lt;sex={'F'}&amp;gt;}id))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="c-files_container"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="c-files_container"&gt;I have tried this:&lt;/DIV&gt;&lt;DIV class="c-files_container"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="c-files_container"&gt;&lt;SPAN&gt;if (person_sex = 'M', count(distinct {&amp;lt;sex = {'M'}&amp;gt;}id)*-1 + SUM({1}0), count(distinct{&amp;lt;sex={'F'}&amp;gt;}id + SUM({1}0))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="c-files_container"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="c-files_container"&gt;&lt;SPAN&gt;And this (formatted for my own readability):&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="c-files_container"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="c-files_container"&gt;&lt;SPAN&gt;if (person_sex = 'M', &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="c-files_container"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;if(count(distinct {&amp;lt;sex = {'M'}&amp;gt;}id) &amp;gt; 0,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="c-files_container"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;count(distinct {&amp;lt;sex = {'M'}&amp;gt;}id)*-1,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="c-files_container"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="c-files_container"&gt;&lt;DIV class="c-files_container"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;if(count(distinct {&amp;lt;sex = {'F'}&amp;gt;}id) &amp;gt; 0,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="c-files_container"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;count(distinct {&amp;lt;sex = {'F'}&amp;gt;}id),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="c-files_container"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="c-files_container"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="c-files_container"&gt;&lt;SPAN&gt;I also tried substituting the zeroes for ones as&amp;nbsp;the default just to try to see some kind of bar.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="c-files_container"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="c-files_container"&gt;&lt;SPAN&gt;Any ideas or&amp;nbsp;help is appreciated!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="c-files_container"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="c-files_container"&gt;&lt;P&gt;I read through&amp;nbsp;&lt;A href="https://community.qlik.com/t5/New-to-QlikView/What-does-it-mean-sum-1-0/m-p/64586#M16382" target="_blank" rel="noopener"&gt;this solution&lt;/A&gt;&amp;nbsp;(and many others) but it didn't help me.&lt;/P&gt;&lt;/DIV&gt;&lt;DIV class="c-files_container"&gt;&lt;SPAN&gt;-dan&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Dec 2021 21:38:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Show-zero-values-in-bar-chart/m-p/1672594#M50913</guid>
      <dc:creator>danmcm</dc:creator>
      <dc:date>2021-12-20T21:38:40Z</dc:date>
    </item>
    <item>
      <title>Re: Show zero values in bar chart</title>
      <link>https://community.qlik.com/t5/App-Development/Show-zero-values-in-bar-chart/m-p/1672628#M50921</link>
      <description>&lt;P&gt;Ok well....I have the solution! &amp;nbsp;New expression:&lt;/P&gt;&lt;P&gt;if(person_sex = 'M',&lt;/P&gt;&lt;P&gt;&amp;nbsp; count(distinct {&amp;lt;sex = {'M'}&amp;gt;}id) + sum({1}1)*0,&lt;/P&gt;&lt;P&gt;&amp;nbsp; count(distinct {&amp;lt;sex = {'F'}&amp;gt;}id) * -1 + sum({1}1)*0)&lt;/P&gt;&lt;P&gt;and then under Add-ons -&amp;gt; Data handling I checked "Include zero values".&lt;/P&gt;&lt;P&gt;Whew!!&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2020 16:45:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Show-zero-values-in-bar-chart/m-p/1672628#M50921</guid>
      <dc:creator>danmcm</dc:creator>
      <dc:date>2020-02-05T16:45:42Z</dc:date>
    </item>
    <item>
      <title>Re: Show zero values in bar chart</title>
      <link>https://community.qlik.com/t5/App-Development/Show-zero-values-in-bar-chart/m-p/1672758#M50932</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;It is not working for me, If you have a sample QVF that is working can u attach the file&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2020 04:28:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Show-zero-values-in-bar-chart/m-p/1672758#M50932</guid>
      <dc:creator>Kashyap_R</dc:creator>
      <dc:date>2020-02-06T04:28:23Z</dc:date>
    </item>
    <item>
      <title>Re: Show zero values in bar chart</title>
      <link>https://community.qlik.com/t5/App-Development/Show-zero-values-in-bar-chart/m-p/1674041#M51096</link>
      <description>&lt;P&gt;Sorry, I can't send my QVF file, it's internal/proprietary/whatever. &amp;nbsp;Maybe I can help with your code (not your QVF)? &amp;nbsp;I'm pretty new to this, but I'm catching on slowly.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Feb 2020 17:49:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Show-zero-values-in-bar-chart/m-p/1674041#M51096</guid>
      <dc:creator>danmcm</dc:creator>
      <dc:date>2020-02-10T17:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: Show zero values in bar chart</title>
      <link>https://community.qlik.com/t5/App-Development/Show-zero-values-in-bar-chart/m-p/1735880#M56232</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I applied this to my QSense. (&lt;SPAN&gt;+ sum({1}1)*0) as following:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if((Count(Workbook)/Count(DISTINCT(User))+ sum({1}1)*0) &amp;gt; 0, Count(Workbook)/Count(DISTINCT(User)), 0)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This expression shows me the average visits on Workbooks, and If there's no visits, it shows 0. However, the chart is not affected by filters. I can't filter by month, or by other measures.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Aug 2020 08:32:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Show-zero-values-in-bar-chart/m-p/1735880#M56232</guid>
      <dc:creator>torraroger</dc:creator>
      <dc:date>2020-08-14T08:32:18Z</dc:date>
    </item>
    <item>
      <title>Re: Show zero values in bar chart</title>
      <link>https://community.qlik.com/t5/App-Development/Show-zero-values-in-bar-chart/m-p/1835177#M68983</link>
      <description>&lt;P&gt;This is true, by this method, it is not affected by any other filter selection. Do you know any solution to this?&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/103810"&gt;@danmcm&lt;/a&gt;&amp;nbsp; Thanks in advance &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Sep 2021 11:07:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Show-zero-values-in-bar-chart/m-p/1835177#M68983</guid>
      <dc:creator>ioannaiogr</dc:creator>
      <dc:date>2021-09-10T11:07:25Z</dc:date>
    </item>
    <item>
      <title>Re: Show zero values in bar chart</title>
      <link>https://community.qlik.com/t5/App-Development/Show-zero-values-in-bar-chart/m-p/1848921#M70157</link>
      <description>&lt;P&gt;Sorry, I no longer have a license for Qlik, so I cannot test that code. &amp;nbsp;But my solution did work and filtered as expected.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-dan&lt;/P&gt;</description>
      <pubDate>Tue, 19 Oct 2021 14:24:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Show-zero-values-in-bar-chart/m-p/1848921#M70157</guid>
      <dc:creator>danmcm</dc:creator>
      <dc:date>2021-10-19T14:24:48Z</dc:date>
    </item>
  </channel>
</rss>

