<?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: Normalise a chart to 0-1 in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Normalise-a-chart-to-0-1/m-p/1948555#M78183</link>
    <description>&lt;P&gt;Should be the same, but you might need to use aggr() to tell Qlik what the max and min values are aggregated by since it won't be aware of what your dimensions are otherwise.&lt;/P&gt;
&lt;P&gt;e.g. Max(Aggr(Sum(Count),Date))&lt;/P&gt;</description>
    <pubDate>Mon, 27 Jun 2022 13:37:35 GMT</pubDate>
    <dc:creator>Or</dc:creator>
    <dc:date>2022-06-27T13:37:35Z</dc:date>
    <item>
      <title>Normalise a chart to 0-1</title>
      <link>https://community.qlik.com/t5/App-Development/Normalise-a-chart-to-0-1/m-p/1948531#M78180</link>
      <description>&lt;P&gt;This is super easy to do in Python / Excel&amp;nbsp; &amp;nbsp;- but given a line chart with say a time series axis,&amp;nbsp; a categorical dimension , and a range of values from negative to positive, is there an easy way to scale them?&lt;/P&gt;
&lt;P&gt;If I have value x for example,&amp;nbsp; where x ranged from&amp;nbsp; - 1000&amp;nbsp; to&amp;nbsp; +2000&amp;nbsp; &amp;nbsp;then for the normalised scale I'd have&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;x'&amp;nbsp; =&amp;nbsp; &amp;nbsp; &amp;nbsp; (&amp;nbsp; x - min(x) )&amp;nbsp; / ( max(x) - min(x) )&lt;/P&gt;
&lt;P&gt;Is there a function to do this in QlikSense that I'm missing?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes I can do it in load script , however it'd be more useful as a chart function as it'd work based on selection context.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="110_0-1656335492697.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/82721iE6872B147AA8D5EA/image-size/large?v=v2&amp;amp;px=999" role="button" title="110_0-1656335492697.png" alt="110_0-1656335492697.png" /&gt;&lt;/span&gt;&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2022 13:12:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Normalise-a-chart-to-0-1/m-p/1948531#M78180</guid>
      <dc:creator>110</dc:creator>
      <dc:date>2022-06-27T13:12:17Z</dc:date>
    </item>
    <item>
      <title>Re: Normalise a chart to 0-1</title>
      <link>https://community.qlik.com/t5/App-Development/Normalise-a-chart-to-0-1/m-p/1948555#M78183</link>
      <description>&lt;P&gt;Should be the same, but you might need to use aggr() to tell Qlik what the max and min values are aggregated by since it won't be aware of what your dimensions are otherwise.&lt;/P&gt;
&lt;P&gt;e.g. Max(Aggr(Sum(Count),Date))&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2022 13:37:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Normalise-a-chart-to-0-1/m-p/1948555#M78183</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2022-06-27T13:37:35Z</dc:date>
    </item>
    <item>
      <title>Re: Normalise a chart to 0-1</title>
      <link>https://community.qlik.com/t5/App-Development/Normalise-a-chart-to-0-1/m-p/1951300#M78402</link>
      <description>&lt;P&gt;I ended up doing this for a really simple example , where the X Axis is Time Series, Y Axis is Count, and the 'Line' Dimension is the 'Bin' for the individual lines.&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;
&lt;LI-CODE lang="php"&gt;(
	Sum(Count)-  Min(total &amp;lt;Bin&amp;gt;   Count)

)
/
(
	Max(total &amp;lt;Bin&amp;gt;   Count) -  Min(total &amp;lt;Bin&amp;gt;   Count)
)&lt;/LI-CODE&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;
&lt;P&gt;The bottom chart in the&amp;nbsp; example does it with parameters from load script, and shows the same as the pre-calculated normalised data chart&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Up top is the original data set.&amp;nbsp; &amp;nbsp; &amp;nbsp; Ignore the fact Qlik is picking arbitrarily between colours for A and B &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;It'd be cool to have it as a feature like the modifiers for cumulative sum etc as an option in Qlik.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="110_1-1656933646385.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/83245iB5A21EB2E7E25761/image-size/large?v=v2&amp;amp;px=999" role="button" title="110_1-1656933646385.png" alt="110_1-1656933646385.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jul 2022 11:21:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Normalise-a-chart-to-0-1/m-p/1951300#M78402</guid>
      <dc:creator>110</dc:creator>
      <dc:date>2022-07-04T11:21:56Z</dc:date>
    </item>
  </channel>
</rss>

