<?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: Forecasting within load script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Forecasting-within-load-script/m-p/1226458#M391385</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want to calculate things in the script then you first need to create a table that calculates the sum of [Metric Value] aggregated over the fields Date, [Pipe Type], [Interface Type] and Metric. You can add a where clause to filter on [Service Type] = design.&amp;nbsp; Once you can that table you can create a new table to calculate the Linest_B and Linest_M and the division of the two over the sums of Metric over the Date field. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Btw. that expression you posted cannot work. The brackets and parentheses don't match up. I also don't understand how the &amp;gt;= $(Numberofmonths) fits with the rest of the expression&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 25 Nov 2016 09:11:20 GMT</pubDate>
    <dc:creator>Gysbert_Wassenaar</dc:creator>
    <dc:date>2016-11-25T09:11:20Z</dc:date>
    <item>
      <title>Forecasting within load script</title>
      <link>https://community.qlik.com/t5/QlikView/Forecasting-within-load-script/m-p/1226457#M391384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;Hello,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;I have this complex project and need some help. I have a dashboard with several objects mostly based on trend analysis.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;the dashboard is slow because most objects are based on agg function. I am trying to move some of the codes to the load script.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;SPAN style="color: #008000;"&gt;&lt;BR /&gt; &lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;If(&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;Service Type]&lt;/SPAN&gt;='design' ,&lt;SPAN style="color: #800000;"&gt;[Limit]&lt;/SPAN&gt; -&lt;BR /&gt; LINEST_B({$&amp;lt;Date=&amp;gt;} Aggr(Sum({$&amp;lt;Date=&amp;gt;} &lt;SPAN style="color: #800000;"&gt;[Metric Value]&lt;/SPAN&gt;), Date,&lt;SPAN style="color: #800000;"&gt;[Pipe Type]&lt;/SPAN&gt;,&lt;SPAN style="color: #800000;"&gt;[Interface Type]&lt;/SPAN&gt;,Metric), Date))&lt;BR /&gt; / LINEST_M({$&amp;lt;Date=&amp;gt;} Aggr(Sum({$&amp;lt;Date=&amp;gt;} &lt;SPAN style="color: #800000;"&gt;[Metric Value]&lt;/SPAN&gt;), Date,&lt;SPAN style="color: #800000;"&gt;[Pipe Type]&lt;/SPAN&gt;,&lt;SPAN style="color: #800000;"&gt;[Interface Type]&lt;/SPAN&gt;,Metric), Date)), Date) &amp;gt;= &lt;STRONG&gt;&lt;EM style=": ; color: #808080;"&gt;$(Numberofmonths)&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;Note ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;The chart displays the date when specific pipes will hit their limit&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;Dimensions on the Straight table are:&amp;nbsp; ,&lt;SPAN style="color: #800000;"&gt;[Pipe Type]&lt;/SPAN&gt;,&lt;SPAN style="color: #800000;"&gt;[Interface Type]&lt;/SPAN&gt;,Metric&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080;"&gt;$(Numberofmonths)&amp;nbsp;&amp;nbsp; is a variable currently that allows for the selection of 3 ;6;12 months to see those that will hit the limit during that period.&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080;"&gt;Question:&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;&lt;SPAN style="font-size: 12pt;"&gt;is it possible to write a similar query /scenario in&amp;nbsp; the load script&lt;/SPAN&gt; because the above calculation is running on a large amount of data ?&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;any other suggestions or ideas?&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;Regards&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Nov 2016 08:55:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Forecasting-within-load-script/m-p/1226457#M391384</guid>
      <dc:creator>didierodayo</dc:creator>
      <dc:date>2016-11-25T08:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: Forecasting within load script</title>
      <link>https://community.qlik.com/t5/QlikView/Forecasting-within-load-script/m-p/1226458#M391385</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want to calculate things in the script then you first need to create a table that calculates the sum of [Metric Value] aggregated over the fields Date, [Pipe Type], [Interface Type] and Metric. You can add a where clause to filter on [Service Type] = design.&amp;nbsp; Once you can that table you can create a new table to calculate the Linest_B and Linest_M and the division of the two over the sums of Metric over the Date field. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Btw. that expression you posted cannot work. The brackets and parentheses don't match up. I also don't understand how the &amp;gt;= $(Numberofmonths) fits with the rest of the expression&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Nov 2016 09:11:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Forecasting-within-load-script/m-p/1226458#M391385</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2016-11-25T09:11:20Z</dc:date>
    </item>
    <item>
      <title>Re: Forecasting within load script</title>
      <link>https://community.qlik.com/t5/QlikView/Forecasting-within-load-script/m-p/1226459#M391386</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gysbert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the actual script is below.&lt;/P&gt;&lt;P&gt;1- the dimensions are ,&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Node Name]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Interface Name]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,Metric&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;2- &lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Metric Value $(vL.MetricValue)]&lt;/SPAN&gt;&amp;nbsp; is because there are calculated fields in the data such as &lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Metric Value avg] and &lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Metric Value max]&lt;/SPAN&gt;&lt;/SPAN&gt; that the user can select in the front end.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;3- the expression currently works but really slow.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;when you said to aggregate in the load script you mean Group By?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;could you explain how to perform the Linest_B and Linest_M and the division in the load script?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Nov 2016 09:24:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Forecasting-within-load-script/m-p/1226459#M391386</guid>
      <dc:creator>didierodayo</dc:creator>
      <dc:date>2016-11-25T09:24:59Z</dc:date>
    </item>
    <item>
      <title>Re: Forecasting within load script</title>
      <link>https://community.qlik.com/t5/QlikView/Forecasting-within-load-script/m-p/1226460#M391387</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 10.6667px; background-color: #f2f2f2;"&gt;when you said to aggregate in the load script you mean Group By?&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Yes. And the linest functions are just aggregation functions too just like sum so you use a group by for those too. You said your chart dimensions are [Pipe Type],[Interface Type],Metric. You need to aggregate over those fields.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Nov 2016 09:50:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Forecasting-within-load-script/m-p/1226460#M391387</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2016-11-25T09:50:41Z</dc:date>
    </item>
  </channel>
</rss>

