<?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 Using formula to specify range for y axis in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Using-formula-to-specify-range-for-y-axis/m-p/1677119#M51483</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a line graph in an app where the auto range for the y-axis isn't calculating correctly (it goes up to 60m, whereas it needs to only go up to about 7m).&amp;nbsp; I have tried to create a custom range but any formula I have used hasn't given me what I need so at the moment it is hard-coded at 7m.&amp;nbsp; Can anyone help?&lt;/P&gt;&lt;P&gt;For reference, the graph is showing the numbers of different failures types, so there are multiple lines.&amp;nbsp; I attempted the following formulae:&lt;/P&gt;&lt;P&gt;&amp;nbsp;=RangeMax(max(broken_zip_count),count(duplicated_quotes),max(invalid_pk_integrity_count),max(invalid_xml_count),max(skipped_xml_count))&lt;/P&gt;&lt;P&gt;This came out far too low (note that duplicated_quotes needs to be different).&amp;nbsp; I then tried:&lt;/P&gt;&lt;P&gt;=RangeMax(sum(broken_zip_count),count(duplicated_quotes),sum(invalid_pk_integrity_count),sum(invalid_xml_count),sum(skipped_xml_count))&lt;/P&gt;&lt;P&gt;This came out far too high.&amp;nbsp; Where am I going wrong?&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 19 Feb 2020 15:05:00 GMT</pubDate>
    <dc:creator>JediBabe</dc:creator>
    <dc:date>2020-02-19T15:05:00Z</dc:date>
    <item>
      <title>Using formula to specify range for y axis</title>
      <link>https://community.qlik.com/t5/App-Development/Using-formula-to-specify-range-for-y-axis/m-p/1677119#M51483</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a line graph in an app where the auto range for the y-axis isn't calculating correctly (it goes up to 60m, whereas it needs to only go up to about 7m).&amp;nbsp; I have tried to create a custom range but any formula I have used hasn't given me what I need so at the moment it is hard-coded at 7m.&amp;nbsp; Can anyone help?&lt;/P&gt;&lt;P&gt;For reference, the graph is showing the numbers of different failures types, so there are multiple lines.&amp;nbsp; I attempted the following formulae:&lt;/P&gt;&lt;P&gt;&amp;nbsp;=RangeMax(max(broken_zip_count),count(duplicated_quotes),max(invalid_pk_integrity_count),max(invalid_xml_count),max(skipped_xml_count))&lt;/P&gt;&lt;P&gt;This came out far too low (note that duplicated_quotes needs to be different).&amp;nbsp; I then tried:&lt;/P&gt;&lt;P&gt;=RangeMax(sum(broken_zip_count),count(duplicated_quotes),sum(invalid_pk_integrity_count),sum(invalid_xml_count),sum(skipped_xml_count))&lt;/P&gt;&lt;P&gt;This came out far too high.&amp;nbsp; Where am I going wrong?&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2020 15:05:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-formula-to-specify-range-for-y-axis/m-p/1677119#M51483</guid>
      <dc:creator>JediBabe</dc:creator>
      <dc:date>2020-02-19T15:05:00Z</dc:date>
    </item>
    <item>
      <title>Re: Using formula to specify range for y axis</title>
      <link>https://community.qlik.com/t5/App-Development/Using-formula-to-specify-range-for-y-axis/m-p/1677231#M51491</link>
      <description>&lt;P&gt;I am guessing you have a dimension on the X axis, and your formula for the range covers all of that dimension's values, so using sum (in your second formula) made the max too big.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If your data model has values for broken_zip_count for each day, and your chart summarizes by month or year, then you need to find max(sum(broken_zip_count)) for each month or year.&amp;nbsp; And then adjust the Y axis range accordingly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;You could do that in your load script, or using Aggr (which could degrade performance if you have a lot of data):&lt;/P&gt;&lt;P&gt;Max(Aggr(Sum(broken_zip_count), [timeperiod]))&lt;/P&gt;&lt;P&gt;Finally, your Y axis range formula becomes:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;=RangeMax(Max(Aggr(Sum(broken_zip_count), [timeperiod])), Max(Aggr(count(duplicated_quotes), [timeperiod])), max(Aggr(sum(invalid_pk_integrity_count), [timeperiod])), max(Aggr(sum(invalid_xml_count), [timeperiod])), max(Aggr(sum(skipped_xml_count), [timeperiod])))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Of course, adjust the inner function to whatever is most logical for that field. I assume Sum everywhere except on duplicated_quotes.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2020 18:40:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-formula-to-specify-range-for-y-axis/m-p/1677231#M51491</guid>
      <dc:creator>Lauri</dc:creator>
      <dc:date>2020-02-19T18:40:52Z</dc:date>
    </item>
  </channel>
</rss>

