<?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 Bar Chart integration of expression in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Bar-Chart-integration-of-expression/m-p/1954033#M78678</link>
    <description>&lt;P&gt;Hello, I have an excel sheet with this format :&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LouisJ_0-1657544994812.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/83809i5CEA90785081818D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LouisJ_0-1657544994812.png" alt="LouisJ_0-1657544994812.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need to make a bar chart representing the number of Reports ( count(ID) ) for one category per location devided by the monthly measure.&amp;nbsp; I have no problem when restricing the date to one month, but when I use multiple months problems arrise.&lt;/P&gt;
&lt;P&gt;For this to work, I need to count the corresponding number of reports, then devide them by the sum of monthly measures per month (But only 1 per location and per month !!!!)&lt;/P&gt;
&lt;P&gt;So for example, if I did it for location 1 in category A, I would have 4/(1.8+1.8), and not devided by 4*1.8 since 4 reports are from only 2 distinct months and so the monthly measure needs to be counted only once per month.&lt;/P&gt;
&lt;P&gt;I have come up with this formula :&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Count(if(match([Category],'A'),[ID])) /&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;sum(aggr(avg(if(match([Category],'A'),[Monthly Measure])),[Month]))&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;This formula works perfectly if I place it in a KPI block or a text block, but for some reason when I place it in the bar chart it groups everything into one location. (The Bar Chart dimension is simply put on Location)&lt;/P&gt;
&lt;P&gt;What would the problem be here ? Any alternative expressions to do this correctly ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(edit: simplified the formula with avg aggregation, it still works in KPI block but not bar chart measure)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 11 Jul 2022 13:12:48 GMT</pubDate>
    <dc:creator>LouisJ</dc:creator>
    <dc:date>2022-07-11T13:12:48Z</dc:date>
    <item>
      <title>Bar Chart integration of expression</title>
      <link>https://community.qlik.com/t5/App-Development/Bar-Chart-integration-of-expression/m-p/1954033#M78678</link>
      <description>&lt;P&gt;Hello, I have an excel sheet with this format :&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LouisJ_0-1657544994812.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/83809i5CEA90785081818D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LouisJ_0-1657544994812.png" alt="LouisJ_0-1657544994812.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need to make a bar chart representing the number of Reports ( count(ID) ) for one category per location devided by the monthly measure.&amp;nbsp; I have no problem when restricing the date to one month, but when I use multiple months problems arrise.&lt;/P&gt;
&lt;P&gt;For this to work, I need to count the corresponding number of reports, then devide them by the sum of monthly measures per month (But only 1 per location and per month !!!!)&lt;/P&gt;
&lt;P&gt;So for example, if I did it for location 1 in category A, I would have 4/(1.8+1.8), and not devided by 4*1.8 since 4 reports are from only 2 distinct months and so the monthly measure needs to be counted only once per month.&lt;/P&gt;
&lt;P&gt;I have come up with this formula :&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Count(if(match([Category],'A'),[ID])) /&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;sum(aggr(avg(if(match([Category],'A'),[Monthly Measure])),[Month]))&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;This formula works perfectly if I place it in a KPI block or a text block, but for some reason when I place it in the bar chart it groups everything into one location. (The Bar Chart dimension is simply put on Location)&lt;/P&gt;
&lt;P&gt;What would the problem be here ? Any alternative expressions to do this correctly ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(edit: simplified the formula with avg aggregation, it still works in KPI block but not bar chart measure)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2022 13:12:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Bar-Chart-integration-of-expression/m-p/1954033#M78678</guid>
      <dc:creator>LouisJ</dc:creator>
      <dc:date>2022-07-11T13:12:48Z</dc:date>
    </item>
  </channel>
</rss>

