<?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 SV:Re: Problem with linest_m function in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problem-with-linest-m-function/m-p/208997#M1208453</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried adding "CUSTOMER" or "CUSTOMERID" in aggr()?&lt;/P&gt;&lt;P&gt;linest_m(aggr (sum( ORDERS), DAY,CUSTOMER), DAY)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 27 Jan 2010 21:51:28 GMT</pubDate>
    <dc:creator>frank_carlsson</dc:creator>
    <dc:date>2010-01-27T21:51:28Z</dc:date>
    <item>
      <title>Problem with linest_m function</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-linest-m-function/m-p/208994#M1208450</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;I've been following this forum quite a while and it has already helped me with a lot of issues, however I am now facing a problem for which I haven't found a solution yet!&lt;/P&gt;&lt;P&gt;I've got the following fields:&lt;/P&gt;&lt;DIV&gt;CompanyID&lt;/DIV&gt;&lt;P&gt;Number of orders / day&lt;/P&gt;&lt;P&gt;Now I want to display a trend in a table showing the gradient of the trend function over a period of time (7 days, 1 month, all-time)&lt;/P&gt;&lt;P&gt;Looking back at my stats expierences from school and university this should surely be the gradient of the regression formula. There is a statistics formula for the gradient which is quite hard to calculate in Qlikview, but looking at the Help files and the handbook, Qlikview offers the Linest_m function which throws out the gradient.&lt;/P&gt;&lt;P&gt;All good up to this point. I can display the gradient for a specific customer and a specific month using the following formula:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;linest_m( {&amp;lt;CUSTOMERID = {"ABC"}, MONTH = {"Jan*"}&amp;gt;} total aggr((sum( {&amp;lt;CUSTOMERID = {"ABC"}, MONTH = {"Jan*"}&amp;gt;} ORDERS)),DAY),DAY)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Now I want to display the gradient in a table with the dimesion CUSTOMERID.&lt;/P&gt;&lt;P&gt;Using:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;linest_m(total &amp;lt;CUSTOMERID&amp;gt; aggr ((sum(ORDERS)), DAY),DAY)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;linest_m(total &amp;lt;CUSTOMERID&amp;gt; aggr ((sum(total &amp;lt;CUSTOMERID&amp;gt; ORDERS)), DAY),DAY)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;But this doesn't work out. Qlikview displays seemingly random figures in the first two rows and a "-" for all the other rows (Customers).&lt;/P&gt;&lt;P&gt;Only if I select a specific Customer from a listbox I get shown the (correct) gradient in the table, but I would like to see all the values even if no Customer is selected so that one can see at a glance how the trend of incoming orders has been for a period of time. (Displayed as number and probably with a coloured arrow),&lt;/P&gt;&lt;P&gt;I hope that you could understand what my problem is, and that somebody will be able to help as I have been experimenting for quite a while and couldn't get it to work.&lt;/P&gt;&lt;P&gt;Maybe the linest_m approach isen't even the correct way to tackle the problem..any other suggetions are welcome!&lt;/P&gt;&lt;P&gt;Thanks very much in advance!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jan 2010 09:43:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-linest-m-function/m-p/208994#M1208450</guid>
      <dc:creator />
      <dc:date>2010-01-19T09:43:30Z</dc:date>
    </item>
    <item>
      <title>Problem with linest_m function</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-linest-m-function/m-p/208995#M1208451</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about adding an expression like Sum() or Avg() around the linest_m() expression?&lt;/P&gt;&lt;P&gt;The Avg() expression should then calculate the average slope of the current selected customers (or all if none is selected).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jan 2010 19:24:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-linest-m-function/m-p/208995#M1208451</guid>
      <dc:creator />
      <dc:date>2010-01-20T19:24:08Z</dc:date>
    </item>
    <item>
      <title>Problem with linest_m function</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-linest-m-function/m-p/208996#M1208452</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mark,&lt;/P&gt;&lt;P&gt;sounded like a very good idea, but it didn't work. the AVG() expression gives back the same result as the linest_m() - but fails to give back the trend for each customer in one column.&lt;/P&gt;&lt;P&gt;What I would like to get is something like this:&lt;/P&gt;&lt;P&gt;CUSTOMER ORDERS/per month TREND/ 30 days TREND / 7 days&lt;/P&gt;&lt;P&gt;ABC 1000 30 10&lt;/P&gt;&lt;P&gt;XYZ 2000 60 90&lt;/P&gt;&lt;P style="font-weight: bold"&gt;sum 3000 50 63,33&lt;/P&gt;&lt;P&gt;What I see using linest_m( total aggr (sum( ORDERS), DAY), DAY) is:&lt;/P&gt;&lt;P&gt;CUSTOMER ORDERS/per month TREND/ 30 days TREND / 7 days&lt;/P&gt;&lt;P&gt;ABC 1000 50 63,33&lt;/P&gt;&lt;P&gt;XYZ 2000 50 63,33&lt;/P&gt;&lt;P style="font-weight: bold"&gt;sum 3000 50 63,33&lt;/P&gt;&lt;P&gt;If I use a sum() expression around the linest_m expression I get wrong (really high) values.&lt;/P&gt;&lt;P&gt;Maybe the linest_m() is the wrong approach for this kind of problem and there is a much easier solution!?&lt;/P&gt;&lt;P&gt;Also I have got the "total" inside the linest_m() function under suspicion that it is responsible for disregarding the charts dimesion (Customer).&lt;/P&gt;&lt;P&gt;But leaving total out of the expression doesn't work either.&lt;/P&gt;&lt;P&gt;I hope that somebody might have an other idea to solve this problem!&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stephan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jan 2010 17:58:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-linest-m-function/m-p/208996#M1208452</guid>
      <dc:creator />
      <dc:date>2010-01-22T17:58:21Z</dc:date>
    </item>
    <item>
      <title>SV:Re: Problem with linest_m function</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-linest-m-function/m-p/208997#M1208453</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried adding "CUSTOMER" or "CUSTOMERID" in aggr()?&lt;/P&gt;&lt;P&gt;linest_m(aggr (sum( ORDERS), DAY,CUSTOMER), DAY)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jan 2010 21:51:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-linest-m-function/m-p/208997#M1208453</guid>
      <dc:creator>frank_carlsson</dc:creator>
      <dc:date>2010-01-27T21:51:28Z</dc:date>
    </item>
    <item>
      <title>SV:Re: Problem with linest_m function</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-linest-m-function/m-p/208998#M1208454</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think Frank has the right idea ... add CUSTOMER as a parameter for the AGGR() function.&lt;/P&gt;&lt;P&gt;If that doesn't work, could you post your current application so we can take a look at it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Feb 2010 09:08:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-linest-m-function/m-p/208998#M1208454</guid>
      <dc:creator />
      <dc:date>2010-02-15T09:08:05Z</dc:date>
    </item>
    <item>
      <title>SV:Re: Problem with linest_m function</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-linest-m-function/m-p/208999#M1208455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;While building a test-application for the community I tried it once more and it finally worked out!&lt;/P&gt;&lt;P&gt;So Problem solved, the addition of the CUSTOMERID to the aggr function worked!&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks very much for your help!&lt;/P&gt;&lt;P&gt;Stephan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Feb 2010 14:30:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-linest-m-function/m-p/208999#M1208455</guid>
      <dc:creator />
      <dc:date>2010-02-16T14:30:24Z</dc:date>
    </item>
  </channel>
</rss>

