<?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: Possible to add condition for showing linear trendline? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Possible-to-add-condition-for-showing-linear-trendline/m-p/445007#M1154263</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As far as I know the reference lines you can add on the Presentation tab can only be horizontal or vertical (depending on the axis you select). You'll have to add your reference line as an expression. Unfortunately that's not possible in a scatter chart. And trying to create a line chart and overlay it on the scatter chart so it display just right is going to be very very difficult. Probably the easiest solution is to create two scatter charts, one with the reference line and one without and show/hide the right one as needed. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 15 Mar 2013 10:23:34 GMT</pubDate>
    <dc:creator>Gysbert_Wassenaar</dc:creator>
    <dc:date>2013-03-15T10:23:34Z</dc:date>
    <item>
      <title>Possible to add condition for showing linear trendline?</title>
      <link>https://community.qlik.com/t5/QlikView/Possible-to-add-condition-for-showing-linear-trendline/m-p/445006#M1154262</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a scatter-plot with the following properties:&lt;BR /&gt;Dimension: &lt;SPAN style="font-family: 'courier new', courier;"&gt;Cofely.Id&lt;/SPAN&gt; (Recno())&lt;/P&gt;&lt;P&gt;x-expression:&lt;SPAN style="font-family: 'courier new', courier;"&gt; Avg({TW1 &amp;lt;Cofely.Temperature ={"&amp;gt;=$(=Min(Cofely.Temperature)) &amp;lt;=$(=max(Cofely.Temperature))"}&amp;gt;}Cofely.Temperature )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;y-expression: &lt;SPAN style="font-family: 'courier new', courier;"&gt;Avg({TW1}($(vActiveUnitField)))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;vActiveUnitField&lt;/SPAN&gt; is a variable which can hold the following fields: &lt;SPAN style="font-family: 'courier new', courier;"&gt;Cofely.GasInm3&lt;/SPAN&gt;,&lt;SPAN style="font-family: 'courier new', courier;"&gt; Cofely.GasInkWh&lt;/SPAN&gt; or&lt;SPAN style="font-family: 'courier new', courier;"&gt; Cofely.GasInMJ&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To get a regressionline I selected the Linear checkbox under trendlines. That works well. However, I want to be able to turn the regression line on or off according to a checkbox that is checked. It seems like it is not possible to add a condition to the regression line. I know that there's an option under the Presentation-tab of the chart properties to add a &lt;EM&gt;reference line&lt;/EM&gt;. This means that I must give the formula of the line. The line has the following defenition: &lt;EM style="font-family: 'courier new', courier;"&gt;y = mx + b&lt;/EM&gt;. &lt;/P&gt;&lt;P&gt;I learned (with the help of the community) that &lt;EM&gt;m&lt;/EM&gt; and &lt;EM&gt;b&lt;/EM&gt; can be calculated with the &lt;EM&gt;LINEST&lt;/EM&gt; functions. The values are as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;m:&amp;nbsp; &lt;SPAN style="color: #737373; font-family: 'courier new', courier; background-color: #ffffff;"&gt;LINEST_M(aggr(NODISTINCT Avg({TW1}($(vActiveUnitField))),Cofely.Id),aggr(NODISTINCT Avg({TW1}Cofely.Temperature),Cofely.Id))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #737373; font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;b: &lt;SPAN style="color: #737373; font-family: 'courier new', courier; background-color: #ffffff;"&gt;LINEST_B(aggr(NODISTINCT Avg({TW1}($(vActiveUnitField))),Cofely.Id),aggr(NODISTINCT Avg({TW1}Cofely.Temperature),Cofely.Id)) &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What would be the appropriate expression/value for x?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Mar 2013 09:58:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Possible-to-add-condition-for-showing-linear-trendline/m-p/445006#M1154262</guid>
      <dc:creator />
      <dc:date>2013-03-15T09:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to add condition for showing linear trendline?</title>
      <link>https://community.qlik.com/t5/QlikView/Possible-to-add-condition-for-showing-linear-trendline/m-p/445007#M1154263</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As far as I know the reference lines you can add on the Presentation tab can only be horizontal or vertical (depending on the axis you select). You'll have to add your reference line as an expression. Unfortunately that's not possible in a scatter chart. And trying to create a line chart and overlay it on the scatter chart so it display just right is going to be very very difficult. Probably the easiest solution is to create two scatter charts, one with the reference line and one without and show/hide the right one as needed. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Mar 2013 10:23:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Possible-to-add-condition-for-showing-linear-trendline/m-p/445007#M1154263</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-03-15T10:23:34Z</dc:date>
    </item>
  </channel>
</rss>

