<?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 Show Equation via macro in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Show-Equation-via-macro/m-p/235300#M86570</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;Interesting thread..&lt;/P&gt;&lt;P&gt;i was wondering if i can reuse the linear regression equation elsewhere. That is, i am looking for a function which extracts the equation as a string for me to treat it as an expression? something like the linest_* family of functions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually, i dont get the same regression equation when i generate it as a trendline from the chart properties and when i run the functions on the same two fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Aug 2010 17:40:53 GMT</pubDate>
    <dc:creator>mantaq10</dc:creator>
    <dc:date>2010-08-10T17:40:53Z</dc:date>
    <item>
      <title>Show Equation via macro</title>
      <link>https://community.qlik.com/t5/QlikView/Show-Equation-via-macro/m-p/235293#M86563</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;I create a macro that add a trend line to a chart. How can I add the trend line equation via macro?&lt;/P&gt;&lt;P&gt;This is the macro:&lt;/P&gt;&lt;P&gt;sub add_lintrendline&lt;BR /&gt;set chart = ActiveDocument.GetSheetObject( "CH50" )&lt;BR /&gt;chart.AddTrend 1,1,1&lt;BR /&gt;set p = chart.GetProperties&lt;BR /&gt;p.ChartProperties.TrendLineWidth = 5&lt;BR /&gt;chart.SetProperties p&lt;BR /&gt;end sub&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 May 2010 16:16:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Show-Equation-via-macro/m-p/235293#M86563</guid>
      <dc:creator />
      <dc:date>2010-05-07T16:16:19Z</dc:date>
    </item>
    <item>
      <title>Show Equation via macro</title>
      <link>https://community.qlik.com/t5/QlikView/Show-Equation-via-macro/m-p/235294#M86564</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The trendline equation is defined by the parameters passed to AddTrend. The first parameter tells you which expression to trend. The second is the type of trend (1 for polynomial, 2 for exponential). Then if you choose polynomial, the third parameter tells you which degree.&lt;/P&gt;&lt;P&gt;So if you want to set a Polynomial of the 2nd Degree on the first expressions, you would use:&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;AddTrend(0,1,2)&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;The third parameter is (only when using 1 as the second parameter):&lt;BR /&gt; 0 Mean&lt;BR /&gt; 1 Linear&lt;BR /&gt; 2 Polynomial 2nd Degree&lt;BR /&gt; 3 Polynomial 3nd Degree&lt;BR /&gt; 4 Polynomial 4nd Degree&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 May 2010 18:29:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Show-Equation-via-macro/m-p/235294#M86564</guid>
      <dc:creator />
      <dc:date>2010-05-07T18:29:57Z</dc:date>
    </item>
    <item>
      <title>Show Equation via macro</title>
      <link>https://community.qlik.com/t5/QlikView/Show-Equation-via-macro/m-p/235295#M86565</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the explanation.&lt;/P&gt;&lt;P&gt;But I want to show (via macro) the equ&lt;IMG alt="" /&gt;ation on the chart, like this:&lt;IMG alt="" /&gt;&lt;IMG alt="" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 May 2010 08:22:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Show-Equation-via-macro/m-p/235295#M86565</guid>
      <dc:creator />
      <dc:date>2010-05-10T08:22:21Z</dc:date>
    </item>
    <item>
      <title>Show Equation via macro</title>
      <link>https://community.qlik.com/t5/QlikView/Show-Equation-via-macro/m-p/235296#M86566</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't know that it is possible to get that equation into a macro. I did not see anything in the API that would allow that. It could be available but undocumented.&lt;/P&gt;&lt;P&gt;If you really wanted to make your life difficult, you could probably determine the equation of the trend line yourself. There are probably equations out there to determine a trend line. I would probably tell the users it was impossible before I tried that though. &lt;IMG alt="Big Smile" src="http://community.qlik.com/emoticons/emotion-2.gif" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 May 2010 22:05:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Show-Equation-via-macro/m-p/235296#M86566</guid>
      <dc:creator />
      <dc:date>2010-05-10T22:05:22Z</dc:date>
    </item>
    <item>
      <title>Show Equation via macro</title>
      <link>https://community.qlik.com/t5/QlikView/Show-Equation-via-macro/m-p/235297#M86567</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found this example in API guide, but I think that it is not useful for me:&lt;/P&gt;&lt;P&gt;set chart = ActiveDocument.ActiveSheet.CreateBarChart&lt;BR /&gt;chart.AddDimension "ProductType"&lt;BR /&gt;chart.AddExpression "count(Customer)"&lt;BR /&gt;set p = chart.GetProperties&lt;BR /&gt;set expr = p.Expressions.Item(0).Item(0).Data.ExpressionVisual&lt;BR /&gt;expr.ShowAsBar = true&lt;BR /&gt;rem add linear regression trend line&lt;BR /&gt;expr.ExpressionTypes.Add&lt;BR /&gt;expr.ExpressionTypes(0).Type = 1&lt;BR /&gt;expr.ExpressionTypes(0).Order = 1&lt;BR /&gt;expr.ExpressionTypes(0).DisplayEquation = true&lt;BR /&gt;chart.SetProperties p&lt;/P&gt;&lt;P&gt;Any ideas????&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 May 2010 08:53:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Show-Equation-via-macro/m-p/235297#M86567</guid>
      <dc:creator />
      <dc:date>2010-05-11T08:53:55Z</dc:date>
    </item>
    <item>
      <title>Show Equation via macro</title>
      <link>https://community.qlik.com/t5/QlikView/Show-Equation-via-macro/m-p/235298#M86568</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That should be the one. The DisplayEquation member should allow you to set the trendline to be shown or hidden as it's read-write.&lt;/P&gt;&lt;P&gt;expr.ExpressionTypes(0).DisplayEquation = true&lt;/P&gt;&lt;P&gt;Just make sure that you assign the correct expression to &lt;STRONG&gt;expr&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;In this example it's set to the first expression (number 0):&lt;/P&gt;&lt;P&gt;set expr = p.Expressions.Item(0).Item(0).Data.ExpressionVisual&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 May 2010 10:19:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Show-Equation-via-macro/m-p/235298#M86568</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-05-11T10:19:12Z</dc:date>
    </item>
    <item>
      <title>Show Equation via macro</title>
      <link>https://community.qlik.com/t5/QlikView/Show-Equation-via-macro/m-p/235299#M86569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Johannes.&lt;/P&gt;&lt;P&gt;It's works for average, lineare and polynomial (2nd, 3th and 4th degree) but not for exponential, to do this I use this:&lt;/P&gt;&lt;P&gt;expr.ExpressionTypes.Add&lt;BR /&gt;expr.ExpressionTypes(0).Type = 2&lt;BR /&gt;expr.ExpressionTypes(0).Order = 1&lt;BR /&gt;expr.ExpressionTypes(0).DisplayEquation = true&lt;/P&gt;&lt;P&gt;but the exponential trend doesn't appear. Why?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 May 2010 11:19:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Show-Equation-via-macro/m-p/235299#M86569</guid>
      <dc:creator />
      <dc:date>2010-05-11T11:19:47Z</dc:date>
    </item>
    <item>
      <title>Show Equation via macro</title>
      <link>https://community.qlik.com/t5/QlikView/Show-Equation-via-macro/m-p/235300#M86570</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;Interesting thread..&lt;/P&gt;&lt;P&gt;i was wondering if i can reuse the linear regression equation elsewhere. That is, i am looking for a function which extracts the equation as a string for me to treat it as an expression? something like the linest_* family of functions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually, i dont get the same regression equation when i generate it as a trendline from the chart properties and when i run the functions on the same two fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Aug 2010 17:40:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Show-Equation-via-macro/m-p/235300#M86570</guid>
      <dc:creator>mantaq10</dc:creator>
      <dc:date>2010-08-10T17:40:53Z</dc:date>
    </item>
  </channel>
</rss>

