<?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: Variable not working in a chart in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Variable-not-working-in-a-chart/m-p/2022969#M84433</link>
    <description>&lt;P&gt;HI&lt;/P&gt;
&lt;P&gt;Might be, try like below&lt;/P&gt;
&lt;P&gt;((SUM(AttMinutes)/60.0)/AVG(TargetHours)) &amp;gt;= 1&lt;/P&gt;</description>
    <pubDate>Mon, 09 Jan 2023 03:01:13 GMT</pubDate>
    <dc:creator>MayilVahanan</dc:creator>
    <dc:date>2023-01-09T03:01:13Z</dc:date>
    <item>
      <title>Variable not working in a chart</title>
      <link>https://community.qlik.com/t5/App-Development/Variable-not-working-in-a-chart/m-p/2022803#M84424</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have a variable, vAvgHours, which returns an average hours of some data.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And I compare the value of the variable in a chart but the comparison result is not consistent.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the screenshot below, Col1 is $(vAvgHours) and Col2 is $(vAvgHours)&amp;gt;= 1, but as the result is -1 for the first case and 0 for the second case, even though their values are the same.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kjun7603_0-1673033372323.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/97486i944AA5B6A26DF7C3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kjun7603_0-1673033372323.png" alt="kjun7603_0-1673033372323.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Please let me know if I need to include more details in this ticket.&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jan 2023 19:32:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Variable-not-working-in-a-chart/m-p/2022803#M84424</guid>
      <dc:creator>kjun7603</dc:creator>
      <dc:date>2023-01-06T19:32:46Z</dc:date>
    </item>
    <item>
      <title>Re: Variable not working in a chart</title>
      <link>https://community.qlik.com/t5/App-Development/Variable-not-working-in-a-chart/m-p/2022907#M84430</link>
      <description>&lt;P&gt;Hi, what expression is stored in&amp;nbsp;&lt;SPAN&gt;vAvgHours? It could be better if you can upload a qvw with the sample to check what is behind that chart.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Jan 2023 08:18:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Variable-not-working-in-a-chart/m-p/2022907#M84430</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2023-01-07T08:18:05Z</dc:date>
    </item>
    <item>
      <title>Re: Variable not working in a chart</title>
      <link>https://community.qlik.com/t5/App-Development/Variable-not-working-in-a-chart/m-p/2022942#M84431</link>
      <description>&lt;P&gt;Thanks, Rubenmarin. It turned out that&amp;nbsp; aggr calculations (it doesn't necessarily have to be a variable) are not working.&lt;/P&gt;
&lt;P&gt;I attached a qvw file with data loaded. I included a table box with the original source and a table chart with the calculation that I need to figure out. Please let me know if you need more details.&lt;/P&gt;</description>
      <pubDate>Sun, 08 Jan 2023 11:57:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Variable-not-working-in-a-chart/m-p/2022942#M84431</guid>
      <dc:creator>kjun7603</dc:creator>
      <dc:date>2023-01-08T11:57:32Z</dc:date>
    </item>
    <item>
      <title>Re: Variable not working in a chart</title>
      <link>https://community.qlik.com/t5/App-Development/Variable-not-working-in-a-chart/m-p/2022969#M84433</link>
      <description>&lt;P&gt;HI&lt;/P&gt;
&lt;P&gt;Might be, try like below&lt;/P&gt;
&lt;P&gt;((SUM(AttMinutes)/60.0)/AVG(TargetHours)) &amp;gt;= 1&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jan 2023 03:01:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Variable-not-working-in-a-chart/m-p/2022969#M84433</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2023-01-09T03:01:13Z</dc:date>
    </item>
    <item>
      <title>Re: Variable not working in a chart</title>
      <link>https://community.qlik.com/t5/App-Development/Variable-not-working-in-a-chart/m-p/2023048#M84444</link>
      <description>&lt;P&gt;Hi, dividing 40 by 60 is, 0,6666... and by the limits of number lengh at the end Qlik puts a 7, so it's not exactly a third, and when converted to binary it can also lose some precission with decimals.&lt;/P&gt;
&lt;P&gt;As suggested by&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/17935"&gt;@MayilVahanan&lt;/a&gt;&amp;nbsp;it will be better to do the division outside the sum.&lt;/P&gt;
&lt;P&gt;Also you can add a round to limit the decimals used in the comparison, like:&lt;/P&gt;
&lt;P&gt;Round(SUM(AttMinutes)/60,0.01)/Round(AVG(TargetHours),0.01)&amp;gt;=1&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jan 2023 08:42:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Variable-not-working-in-a-chart/m-p/2023048#M84444</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2023-01-09T08:42:10Z</dc:date>
    </item>
    <item>
      <title>Re: Variable not working in a chart</title>
      <link>https://community.qlik.com/t5/App-Development/Variable-not-working-in-a-chart/m-p/2023089#M84445</link>
      <description>&lt;P&gt;Thank you for your reply,&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/22593"&gt;@rubenmarin&lt;/a&gt;.&lt;/P&gt;
&lt;P&gt;That makes sense what happened in the real dashboard (the one I posted here is a sample because of the complexity) is it rounds up for the most of cases but only two lose the precision with decimals. If all lost the precision, it would be easier to find the root cause, but 16 cases out of 18 returned rounded number and two returned the result without some decimal points.&lt;/P&gt;
&lt;P&gt;My problem is resolved but if you can find out the reason of the inconsistent output, that will be great.&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jan 2023 09:52:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Variable-not-working-in-a-chart/m-p/2023089#M84445</guid>
      <dc:creator>kjun7603</dc:creator>
      <dc:date>2023-01-09T09:52:58Z</dc:date>
    </item>
    <item>
      <title>Re: Variable not working in a chart</title>
      <link>https://community.qlik.com/t5/App-Development/Variable-not-working-in-a-chart/m-p/2023096#M84446</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/213108"&gt;@kjun7603&lt;/a&gt;, in the sample all have the same data, if you can upload a sample with the data of those 2 cases I can take a look to see what's happening.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jan 2023 09:58:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Variable-not-working-in-a-chart/m-p/2023096#M84446</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2023-01-09T09:58:23Z</dc:date>
    </item>
  </channel>
</rss>

