<?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: Linest_M and Linest_B ? in Connectivity &amp; Data Prep</title>
    <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Linest-M-and-Linest-B/m-p/1079886#M1719</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply Sweuhl.&lt;/P&gt;&lt;P&gt;I am trying to figure it out in Sense.&lt;/P&gt;&lt;P&gt;To get the trend line in combo chart, how would I use the Linest .&lt;/P&gt;&lt;P&gt;Is it, M and B from script or do I need to use Linest in chart again??&lt;/P&gt;&lt;P&gt;If that is the case, will the values from script and chart matches?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 09 Feb 2016 12:33:32 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-02-09T12:33:32Z</dc:date>
    <item>
      <title>Linest_M and Linest_B ?</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Linest-M-and-Linest-B/m-p/1079884#M1717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could anyone please explain me how linest_m and linest_b works in script and chart when my dimension(X) is date column and measure(Y) is Price, which are grouped materials.&lt;/P&gt;&lt;P&gt;example:&lt;/P&gt;&lt;P&gt;Load * Inline [&lt;/P&gt;&lt;P&gt;Material, InvoiceDate, Price,&lt;/P&gt;&lt;P&gt;A,01/01/2015,60&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;A,01/02/2015,30&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;A,01/03/2015,40&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;B,01/01/2015,12&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px; line-height: 1.5em;"&gt;B,01/01/2015,18&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 13.3333px;"&gt;B,01/01/2015,10&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 13.3333px;"&gt;B,01/01/2015,16&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 13.3333px;"&gt;]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; delimiter is ',';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 13.3333px;"&gt;My main doubt is How Linest work when we have Date column as dimension?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 13.3333px;"&gt;When given given some numeric valued column as dimension, it's working fine.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Prashanth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Feb 2016 11:26:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Linest-M-and-Linest-B/m-p/1079884#M1717</guid>
      <dc:creator />
      <dc:date>2016-02-09T11:26:49Z</dc:date>
    </item>
    <item>
      <title>Re: Linest_M and Linest_B ?</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Linest-M-and-Linest-B/m-p/1079885#M1718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As you mentioned, X and Y values need to be numeric, so read your dates in as numbers:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/2954"&gt;Why don’t my dates work?&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, you need to decide what you want to do with multiple price values per date and material as for material B in your sample. I've decided to average these values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to match the linest_b value the value shown as trend line in the line chart, you need to correct the x-value by subtracting the min value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then your script could look like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14550201477263184 jive_text_macro" jivemacro_uid="_14550201477263184"&gt;
&lt;P&gt;Set DateFormat = 'MM/DD/YYYY';&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;INPUT:&lt;/P&gt;
&lt;P&gt;Load * Inline [&lt;/P&gt;
&lt;P&gt;Material, InvoiceDate, Price,&lt;/P&gt;
&lt;P&gt;A,01/01/2015,60&lt;/P&gt;
&lt;P&gt;A,01/02/2015,30&lt;/P&gt;
&lt;P&gt;A,01/03/2015,40&lt;/P&gt;
&lt;P&gt;B,01/01/2015,12&lt;/P&gt;
&lt;P&gt;B,01/01/2015,18&lt;/P&gt;
&lt;P&gt;B,01/01/2015,10&lt;/P&gt;
&lt;P&gt;B,01/01/2015,16&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;LEFT JOIN&lt;/P&gt;
&lt;P&gt;LOAD Material, Min(InvoiceDate) as MinDate Resident INPUT GROUP BY Material;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;LOAD LINEST_M( AvgPrice, InvoiceDate) as M, LINEST_B(AvgPrice, InvoiceDate-MinDate) as B, Material&lt;/P&gt;
&lt;P&gt;GROUP BY Material;&lt;/P&gt;
&lt;P&gt;LOAD Material, InvoiceDate, Only(MinDate) as MinDate, Avg(Price) as AvgPrice&lt;/P&gt;
&lt;P&gt;Resident INPUT&lt;/P&gt;
&lt;P&gt;GROUP BY Material, InvoiceDate;&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which will only give a M / B values for material A, since you only have one X value for material B.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Compare the values for trend line in chart, see attached sample.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Feb 2016 12:18:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Linest-M-and-Linest-B/m-p/1079885#M1718</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-02-09T12:18:02Z</dc:date>
    </item>
    <item>
      <title>Re: Linest_M and Linest_B ?</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Linest-M-and-Linest-B/m-p/1079886#M1719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply Sweuhl.&lt;/P&gt;&lt;P&gt;I am trying to figure it out in Sense.&lt;/P&gt;&lt;P&gt;To get the trend line in combo chart, how would I use the Linest .&lt;/P&gt;&lt;P&gt;Is it, M and B from script or do I need to use Linest in chart again??&lt;/P&gt;&lt;P&gt;If that is the case, will the values from script and chart matches?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Feb 2016 12:33:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Linest-M-and-Linest-B/m-p/1079886#M1719</guid>
      <dc:creator />
      <dc:date>2016-02-09T12:33:32Z</dc:date>
    </item>
    <item>
      <title>Re: Linest_M and Linest_B ?</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Linest-M-and-Linest-B/m-p/1079887#M1720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You would only calculate this in the script when the result shouldn't change when you make selections.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In general, calculation of linest_m and linest_b should not differ between QS and QV, here is an example in QS:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/thread/129679"&gt;How to add lineal trend in Qlik sense&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that the example chosen by Michael is not the best possible, the dates on the axis are not sequential, so the linear trend doesn't look linear.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Feb 2016 14:32:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Linest-M-and-Linest-B/m-p/1079887#M1720</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-02-09T14:32:45Z</dc:date>
    </item>
    <item>
      <title>Re: Linest_M and Linest_B ?</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Linest-M-and-Linest-B/m-p/1079888#M1721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Swuehl,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IWhat you said is true. It's working for the sample data.&lt;/P&gt;&lt;P&gt;But, when I apply the same to my original data It's not working. I have dates in dimension column. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please explain how Linest_M and Linest_B exactly works??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Feb 2016 14:47:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Linest-M-and-Linest-B/m-p/1079888#M1721</guid>
      <dc:creator />
      <dc:date>2016-02-09T14:47:09Z</dc:date>
    </item>
    <item>
      <title>Re: Linest_M and Linest_B ?</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Linest-M-and-Linest-B/m-p/1079889#M1722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I have gaps in date column, how to fill that gaps as empties but not with zeros. &lt;/P&gt;&lt;P&gt;If I use the same column, I'm not able to get the straight line.&lt;/P&gt;&lt;P&gt;How can I achieve this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="trend line.png" class="jive-image image-1" src="/legacyfs/online/114185_trend line.png" style="height: 384px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Feb 2016 15:05:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Linest-M-and-Linest-B/m-p/1079889#M1722</guid>
      <dc:creator />
      <dc:date>2016-02-10T15:05:36Z</dc:date>
    </item>
    <item>
      <title>Re: Linest_M and Linest_B ?</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Linest-M-and-Linest-B/m-p/1079890#M1723</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Swuehl, I have tried create the same thing but my data has gaps, as pasted below.&amp;nbsp; The values a get are different to the ones in the graph; is it possible to achieve the same slope and intercept when you have gaps?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;A,01/01/2015,60&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;A,01/02/2015,30&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;A,01/03/2015,40&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;A,01/07/2015,50&lt;/LI&gt;&lt;LI&gt;A,01/15/2015,60&amp;nbsp; &lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jul 2016 16:29:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Linest-M-and-Linest-B/m-p/1079890#M1723</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-07-06T16:29:00Z</dc:date>
    </item>
  </channel>
</rss>

