<?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>article Calculating trend lines, values and formulas on charts and tables in Qlik Sense in Qlik Sense Documents</title>
    <link>https://community.qlik.com/t5/Qlik-Sense-Documents/Calculating-trend-lines-values-and-formulas-on-charts-and-tables/ta-p/1479463</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I spent a little time working through the formulas required to mimic the trend lines that are available in QlikView and currently not available in Qlik Sense without knowing how to write reasonably complex expressions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here are some examples of exponential and 2nd order polynomial trend lines with the relationship expressed as a formula in the subtitle.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;Exponential Trend Line&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="178597" alt="pic1 - exponential.PNG" class="jive-image image-3" src="/legacyfs/online/178597_pic1 - exponential.PNG" style="height: 245px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;2nd order polynomial trend line&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="178596" alt="pic2 - polynomial.PNG" class="jive-image image-2" src="/legacyfs/online/178596_pic2 - polynomial.PNG" style="height: 243px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To make things as clear as possible I have included the Excel variants of these formulas so you have something to reference as I have done whilst checking these formulas calculate correctly. These excel formulas were sourced from &lt;A href="http://spreadsheetpage.com/index.php/tip/chart_trendline_formulas/" title="http://spreadsheetpage.com/index.php/tip/chart_trendline_formulas/"&gt;Excel Tips From John Walkenbach: Chart Trendline Formulas&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The below table shows the equivalent formulas in Qlik for the excel formulas provided. I have also attached a QVF file with examples of each one so that you have something real to reference as you build these into your own applications. In addition I have included the excel file that I was using for testing to ensure my calculations were correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid #000000; width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;H2&gt;&lt;STRONG&gt;Excel Formulas&lt;/STRONG&gt;&lt;/H2&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;H2&gt;&lt;STRONG&gt;Qlik Formulas&lt;/STRONG&gt;&lt;/H2&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;H3&gt;Linear Trendline&lt;/H3&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;Equation&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;y = m * x + b&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;y = m * x + b&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;m&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: left;"&gt;= SLOPE(y,x)&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: left;"&gt;= LINEST_M(y,x)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;b&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;= INTERCEPT(y,x)&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;= LINEST_B(y,x)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;H3&gt;Logarithmic Trendline&lt;/H3&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;Equation&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: left;"&gt;y = (c * LN(x)) + b&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: left;"&gt;y = (c * LOG(x)) + b&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;c&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: left;"&gt;= INDEX(LINEST(y,LN(x)),1)&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: left;"&gt;= LINEST_M(y,LOG(x))&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;b&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: left;"&gt;= INDEX(LINEST(y,LN(x)),1,2)&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;= LINEST_B(y,LOG(x))&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;H3&gt;Power Trendline&lt;/H3&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;Equation&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;y=c*x^b&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;y = c * POW( x , b)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;c&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;= EXP(INDEX(LINEST(LN(y),LN(x),,),1,2))&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;= EXP(LINEST_B(LOG(y),LOG(x)))&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;b&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;= INDEX(LINEST(LN(y),LN(x),,),1)&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;= LINEST_M(LOG(y),LOG(x))&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;H3&gt;Exponential Trendline&lt;/H3&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;Equation&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;y = c *e ^(b * x)&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;y = c * POW( e , b * x)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;c&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;= EXP(INDEX(LINEST(LN(y),x),1,2))&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;= EXP(LINEST_B(LOG(y),x))&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;b&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;= INDEX(LINEST(LN(y),x),1)&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;= LINEST_M(LOG(y),x)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;e&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;= EXP(1)&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;= e()&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: left;"&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;2nd order Polynomial Trend&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;Equation&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;y = (c2 * x^2) + (c1 * x ^1) + b&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;y = (c2 * POW(x,2)) + (c1 * x) + b&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;c2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;= INDEX(LINEST(y,x^{1,2}),1)&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;see example - variable c2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;c1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;= INDEX(LINEST(y,x^{1,2}),1,2)&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;see example - variable c1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;b&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;= INDEX(LINEST(y,x^{1,2}),1,3)&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;see example - variable b&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H3&gt;&lt;SPAN style="color: #339966;"&gt;Points to note:&lt;/SPAN&gt;&lt;/H3&gt;&lt;OL&gt;&lt;LI&gt;You will see in the QVF that I have used monthly aggregated values from more detailed data which is a real life requirement (you would not necessarily want to create an aggregated table just for this purpose). Therefore the Y values are shown aggregated by the dimension. i.e. aggr(Sum([Expenses (USD)]),MonthYear)&lt;/LI&gt;&lt;LI&gt;The 2nd Order Polynomial trend is a little more complex than the others. I have not found a comparable function to excel LINEST(Y,x^{1,2}) so have managed to find some old examples and put together a longhand version. Please see the variables in the example application.&lt;/LI&gt;&lt;LI&gt;The 2nd Order Polynomial dimension has some specific requirements in the current form of the expressions. It &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;MUST&lt;/STRONG&gt;&lt;/SPAN&gt; be a field with distinct values in the dataset, i.e. MonthYear in my example must have the grain of MonthYear and &lt;STRONG&gt;not&lt;/STRONG&gt; be a field in the calendar table. It should also join directly to the fact where actuals reside, not join through another dimension.&lt;/LI&gt;&lt;/OL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Oct 2017 11:08:54 GMT</pubDate>
    <dc:creator>richbyard</dc:creator>
    <dc:date>2017-10-03T11:08:54Z</dc:date>
    <item>
      <title>Calculating trend lines, values and formulas on charts and tables in Qlik Sense</title>
      <link>https://community.qlik.com/t5/Qlik-Sense-Documents/Calculating-trend-lines-values-and-formulas-on-charts-and-tables/ta-p/1479463</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I spent a little time working through the formulas required to mimic the trend lines that are available in QlikView and currently not available in Qlik Sense without knowing how to write reasonably complex expressions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here are some examples of exponential and 2nd order polynomial trend lines with the relationship expressed as a formula in the subtitle.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;Exponential Trend Line&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="178597" alt="pic1 - exponential.PNG" class="jive-image image-3" src="/legacyfs/online/178597_pic1 - exponential.PNG" style="height: 245px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;2nd order polynomial trend line&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="178596" alt="pic2 - polynomial.PNG" class="jive-image image-2" src="/legacyfs/online/178596_pic2 - polynomial.PNG" style="height: 243px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To make things as clear as possible I have included the Excel variants of these formulas so you have something to reference as I have done whilst checking these formulas calculate correctly. These excel formulas were sourced from &lt;A href="http://spreadsheetpage.com/index.php/tip/chart_trendline_formulas/" title="http://spreadsheetpage.com/index.php/tip/chart_trendline_formulas/"&gt;Excel Tips From John Walkenbach: Chart Trendline Formulas&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The below table shows the equivalent formulas in Qlik for the excel formulas provided. I have also attached a QVF file with examples of each one so that you have something real to reference as you build these into your own applications. In addition I have included the excel file that I was using for testing to ensure my calculations were correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid #000000; width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;H2&gt;&lt;STRONG&gt;Excel Formulas&lt;/STRONG&gt;&lt;/H2&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;H2&gt;&lt;STRONG&gt;Qlik Formulas&lt;/STRONG&gt;&lt;/H2&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;H3&gt;Linear Trendline&lt;/H3&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;Equation&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;y = m * x + b&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;y = m * x + b&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;m&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: left;"&gt;= SLOPE(y,x)&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: left;"&gt;= LINEST_M(y,x)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;b&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;= INTERCEPT(y,x)&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;= LINEST_B(y,x)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;H3&gt;Logarithmic Trendline&lt;/H3&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;Equation&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: left;"&gt;y = (c * LN(x)) + b&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: left;"&gt;y = (c * LOG(x)) + b&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;c&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: left;"&gt;= INDEX(LINEST(y,LN(x)),1)&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: left;"&gt;= LINEST_M(y,LOG(x))&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;b&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: left;"&gt;= INDEX(LINEST(y,LN(x)),1,2)&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;= LINEST_B(y,LOG(x))&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;H3&gt;Power Trendline&lt;/H3&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;Equation&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;y=c*x^b&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;y = c * POW( x , b)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;c&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;= EXP(INDEX(LINEST(LN(y),LN(x),,),1,2))&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;= EXP(LINEST_B(LOG(y),LOG(x)))&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;b&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;= INDEX(LINEST(LN(y),LN(x),,),1)&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;= LINEST_M(LOG(y),LOG(x))&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;H3&gt;Exponential Trendline&lt;/H3&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;Equation&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;y = c *e ^(b * x)&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;y = c * POW( e , b * x)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;c&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;= EXP(INDEX(LINEST(LN(y),x),1,2))&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;= EXP(LINEST_B(LOG(y),x))&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;b&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;= INDEX(LINEST(LN(y),x),1)&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;= LINEST_M(LOG(y),x)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;e&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;= EXP(1)&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;= e()&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: left;"&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;2nd order Polynomial Trend&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;Equation&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;y = (c2 * x^2) + (c1 * x ^1) + b&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;y = (c2 * POW(x,2)) + (c1 * x) + b&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;c2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;= INDEX(LINEST(y,x^{1,2}),1)&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;see example - variable c2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;c1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;= INDEX(LINEST(y,x^{1,2}),1,2)&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;see example - variable c1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;b&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;= INDEX(LINEST(y,x^{1,2}),1,3)&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;see example - variable b&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H3&gt;&lt;SPAN style="color: #339966;"&gt;Points to note:&lt;/SPAN&gt;&lt;/H3&gt;&lt;OL&gt;&lt;LI&gt;You will see in the QVF that I have used monthly aggregated values from more detailed data which is a real life requirement (you would not necessarily want to create an aggregated table just for this purpose). Therefore the Y values are shown aggregated by the dimension. i.e. aggr(Sum([Expenses (USD)]),MonthYear)&lt;/LI&gt;&lt;LI&gt;The 2nd Order Polynomial trend is a little more complex than the others. I have not found a comparable function to excel LINEST(Y,x^{1,2}) so have managed to find some old examples and put together a longhand version. Please see the variables in the example application.&lt;/LI&gt;&lt;LI&gt;The 2nd Order Polynomial dimension has some specific requirements in the current form of the expressions. It &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;MUST&lt;/STRONG&gt;&lt;/SPAN&gt; be a field with distinct values in the dataset, i.e. MonthYear in my example must have the grain of MonthYear and &lt;STRONG&gt;not&lt;/STRONG&gt; be a field in the calendar table. It should also join directly to the fact where actuals reside, not join through another dimension.&lt;/LI&gt;&lt;/OL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Oct 2017 11:08:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Sense-Documents/Calculating-trend-lines-values-and-formulas-on-charts-and-tables/ta-p/1479463</guid>
      <dc:creator>richbyard</dc:creator>
      <dc:date>2017-10-03T11:08:54Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating trend lines, values and formulas on charts and tables in Qlik Sense</title>
      <link>https://community.qlik.com/t5/Qlik-Sense-Documents/Calculating-trend-lines-values-and-formulas-on-charts-and-tables/tac-p/1479464#M479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, this is really useful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Nov 2017 04:17:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Sense-Documents/Calculating-trend-lines-values-and-formulas-on-charts-and-tables/tac-p/1479464#M479</guid>
      <dc:creator>jnolanhcf</dc:creator>
      <dc:date>2017-11-25T04:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating trend lines, values and formulas on charts and tables in Qlik Sense</title>
      <link>https://community.qlik.com/t5/Qlik-Sense-Documents/Calculating-trend-lines-values-and-formulas-on-charts-and-tables/tac-p/1479465#M480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry for my English.&lt;/P&gt;&lt;P&gt;Can it be more accurate?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="NewLogarithmicTrend.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/204515_NewLogarithmicTrend.png" style="height: 261px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;linest_m(total aggr(sum(Expenses),MonthYear),&lt;STRONG&gt;(Aggr(Log(Rowno()) * MonthYear, MonthYear))&lt;/STRONG&gt;)&lt;/P&gt;&lt;P&gt;* &lt;STRONG&gt;(Aggr(Log(Rowno()) * MonthYear, MonthYear))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;+ linest_b(total aggr(sum(Expenses),MonthYear),&lt;STRONG&gt;(Aggr(Log(Rowno()) * MonthYear, MonthYear))&lt;/STRONG&gt;)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jun 2018 20:19:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Sense-Documents/Calculating-trend-lines-values-and-formulas-on-charts-and-tables/tac-p/1479465#M480</guid>
      <dc:creator>andy_2013</dc:creator>
      <dc:date>2018-06-06T20:19:35Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating trend lines, values and formulas on charts and tables in Qlik Sense</title>
      <link>https://community.qlik.com/t5/Qlik-Sense-Documents/Calculating-trend-lines-values-and-formulas-on-charts-and-tables/tac-p/1479466#M481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Andy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Great to share different options so we can find the best fit for our needs but I'd be cautious with your use of the term 'accurate'. To me the yellow line is more representative of the trend than the red one but that is subjective... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you solve the 3rd an 4th order polynomial lines please let me know as this was a step too far for me &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Richard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jul 2018 11:40:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Sense-Documents/Calculating-trend-lines-values-and-formulas-on-charts-and-tables/tac-p/1479466#M481</guid>
      <dc:creator>richbyard</dc:creator>
      <dc:date>2018-07-11T11:40:11Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating trend lines, values and formulas on charts and tables in Qlik Sense</title>
      <link>https://community.qlik.com/t5/Qlik-Sense-Documents/Calculating-trend-lines-values-and-formulas-on-charts-and-tables/tac-p/1479467#M482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Richard, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your solution on the 2nd order polynomial. In your comments you wrote that&amp;nbsp; there is no equivalent INDEX(y,x^{1\2},1). I'm not sure if you already know that {1\2} is an extra x -column. For example: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LINEST_M equals the LINEST function in Excel. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for the following table: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="128"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="20" width="64"&gt;Y value&lt;/TD&gt;&lt;TD width="64"&gt;X value&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="19"&gt;0,6931&lt;/TD&gt;&lt;TD align="right"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="19"&gt;0,7581&lt;/TD&gt;&lt;TD align="right"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="19"&gt;0,7553&lt;/TD&gt;&lt;TD align="right"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the LINEST(Y:Y, X:X) = 0.0311. Same goes for LINEST_M in Qlik. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Adding the ^{1\2] leads to the following table in Excel (first x^1 and second x^2) &lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="192"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="20" width="64"&gt;Y value&lt;/TD&gt;&lt;TD width="64"&gt;X value&lt;/TD&gt;&lt;TD width="64"&gt;X-2 value&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="19"&gt;0,6931&lt;/TD&gt;&lt;TD align="right"&gt;1&lt;/TD&gt;&lt;TD align="right"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="19"&gt;0,7581&lt;/TD&gt;&lt;TD align="right"&gt;2&lt;/TD&gt;&lt;TD align="right"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="19"&gt;0,7553&lt;/TD&gt;&lt;TD align="right"&gt;3&lt;/TD&gt;&lt;TD align="right"&gt;9&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With LINEST(Y:Y ; X:X-2) you'll get -0.0399 which is your C2 value. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the LINEST_M in Qlik comes close to the LINEST function in Excel only I don't exactly know how to get two X-columns into the LINEST_M function. Maybe you are able to figure it out. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you already knew about the two X-columns than you can ignore my post of course. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway thank you very much for the calculations. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2018 14:00:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Sense-Documents/Calculating-trend-lines-values-and-formulas-on-charts-and-tables/tac-p/1479467#M482</guid>
      <dc:creator>avkeep01</dc:creator>
      <dc:date>2018-10-23T14:00:38Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating trend lines, values and formulas on charts and tables in Qlik Sense</title>
      <link>https://community.qlik.com/t5/Qlik-Sense-Documents/Calculating-trend-lines-values-and-formulas-on-charts-and-tables/tac-p/1780885#M4601</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;in a scatterplot where my&amp;nbsp;measures are y=sum(sales) and x=sum(profit) and i have one dimension&lt;/P&gt;&lt;P&gt;my linear regression line would be&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;linest_m(total aggr(sum(sales),dimension)), aggr(sum(profit),dimension)) * sum(profit) + linest_b(total aggr(sum(sales),dimension)), aggr(sum(profit),dimension))&amp;nbsp; ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Feb 2021 14:10:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Sense-Documents/Calculating-trend-lines-values-and-formulas-on-charts-and-tables/tac-p/1780885#M4601</guid>
      <dc:creator>ioannagr</dc:creator>
      <dc:date>2021-02-08T14:10:19Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating trend lines, values and formulas on charts and tables in Qlik Sense</title>
      <link>https://community.qlik.com/t5/Qlik-Sense-Documents/Calculating-trend-lines-values-and-formulas-on-charts-and-tables/tac-p/1951171#M5576</link>
      <description>&lt;P&gt;This is very useful; thank you!&lt;/P&gt;
&lt;P&gt;I have a question though, do you know how to calculate the 3rd Order Polynomial? Any idea please?&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jul 2022 08:03:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Sense-Documents/Calculating-trend-lines-values-and-formulas-on-charts-and-tables/tac-p/1951171#M5576</guid>
      <dc:creator>OmarBenSalem</dc:creator>
      <dc:date>2022-07-04T08:03:33Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating trend lines, values and formulas on charts and tables in Qlik Sense</title>
      <link>https://community.qlik.com/t5/Qlik-Sense-Documents/Calculating-trend-lines-values-and-formulas-on-charts-and-tables/tac-p/2159553#M5790</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/48875"&gt;@richbyard&lt;/a&gt;&amp;nbsp;great - thank you.&lt;BR /&gt;&lt;BR /&gt;Have you already tried to calculate c2, c1 and b for&amp;nbsp;2nd order Polynomial Trend in the data editor/script?&lt;/P&gt;
&lt;P&gt;For the Linear Trend it works fine to calculate m and b in script.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jan 2024 12:13:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Sense-Documents/Calculating-trend-lines-values-and-formulas-on-charts-and-tables/tac-p/2159553#M5790</guid>
      <dc:creator>pwagner</dc:creator>
      <dc:date>2024-01-09T12:13:29Z</dc:date>
    </item>
  </channel>
</rss>

