<?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 Difficulty with Linest_m combined with set analysis and aggr in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Difficulty-with-Linest-m-combined-with-set-analysis-and-aggr/m-p/1067130#M356723</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;I have a problem with the LINEST_M function I can’t seem to figure out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have two objects: A line chart and a straight chart. In the line chart I have a Dimension YearMonth (which is of date-type and is basically the first day of the month of a transaction) and an expression Sum([Customs duty paid]) / Sum([Customs value]).&lt;/P&gt;&lt;P&gt;The straight chart has a double function: making a selection in the country of destination and showing some information. It has dimension [Country of destination], and the following expressions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;[Country of destination]&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; = &amp;gt;} &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;[Customs value]&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;) //Hidden and just for sorting&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: blue;"&gt;num&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: blue;"&gt;sum&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: black;"&gt;({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: maroon;"&gt;[Country of destination]&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: black;"&gt;=&amp;gt;} &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: maroon;"&gt;[Customs duty paid]&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: black;"&gt;) / &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: blue;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: black;"&gt;({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: maroon;"&gt;[Country of destination]&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: black;"&gt;=&amp;gt;} &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: maroon;"&gt;[Customs value]&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: black;"&gt;),'##.##%') //Applied duty rate percentage&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;if&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;LINEST_M&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;[Country of destination]&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; = &amp;gt;} &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;sum&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;[Customs duty paid]&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;)/&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;[Customs value]&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;), &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;YearMonth&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;),&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;YearMonth&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;)&lt;BR /&gt; &amp;gt; 0,'qmem://&amp;lt;bundled&amp;gt;/BuiltIn/arrow_n.png',&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;if&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;LINEST_M&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;[Country of destination]&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; = &amp;gt;} &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;sum&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;[Customs duty paid]&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;)/&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;[Customs value]&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;), &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;YearMonth&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;),&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;YearMonth&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;) &lt;BR /&gt; &amp;lt; 0,'qmem://&amp;lt;bundled&amp;gt;/BuiltIn/arrow_s.png',)) //Is supposed to show an up arrow if the trendline goes up and a down arrow if the trendline goes down.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to achieve the following:&lt;/P&gt;&lt;P&gt;Show the up-arrow if the trendline for the line-chart goes up for the specific country of destination, and a down-arrow if the trendline goes down for the specific country of destination. This should disregard any selections in [Country of destination], so the arrow should also show when that country has not in the current selection. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only problem I (think I) am running into is with the &lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;LINEST_M&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;[Country of destination]&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; = &amp;gt;} &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;sum&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;[Customs duty paid]&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;)/&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;[Customs value]&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;), &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;YearMonth&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;),&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;YearMonth&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;)&lt;/SPAN&gt; part of the expression. It is doing something, but I’m fairly sure it’s not doing exactly what it’s supposed to. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone help me with this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please also see the attached example.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Apr 2016 10:46:04 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-04-20T10:46:04Z</dc:date>
    <item>
      <title>Difficulty with Linest_m combined with set analysis and aggr</title>
      <link>https://community.qlik.com/t5/QlikView/Difficulty-with-Linest-m-combined-with-set-analysis-and-aggr/m-p/1067130#M356723</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;I have a problem with the LINEST_M function I can’t seem to figure out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have two objects: A line chart and a straight chart. In the line chart I have a Dimension YearMonth (which is of date-type and is basically the first day of the month of a transaction) and an expression Sum([Customs duty paid]) / Sum([Customs value]).&lt;/P&gt;&lt;P&gt;The straight chart has a double function: making a selection in the country of destination and showing some information. It has dimension [Country of destination], and the following expressions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;[Country of destination]&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; = &amp;gt;} &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;[Customs value]&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;) //Hidden and just for sorting&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: blue;"&gt;num&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: blue;"&gt;sum&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: black;"&gt;({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: maroon;"&gt;[Country of destination]&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: black;"&gt;=&amp;gt;} &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: maroon;"&gt;[Customs duty paid]&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: black;"&gt;) / &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: blue;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: black;"&gt;({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: maroon;"&gt;[Country of destination]&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: black;"&gt;=&amp;gt;} &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: maroon;"&gt;[Customs value]&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: black;"&gt;),'##.##%') //Applied duty rate percentage&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;if&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;LINEST_M&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;[Country of destination]&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; = &amp;gt;} &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;sum&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;[Customs duty paid]&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;)/&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;[Customs value]&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;), &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;YearMonth&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;),&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;YearMonth&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;)&lt;BR /&gt; &amp;gt; 0,'qmem://&amp;lt;bundled&amp;gt;/BuiltIn/arrow_n.png',&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;if&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;LINEST_M&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;[Country of destination]&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; = &amp;gt;} &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;sum&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;[Customs duty paid]&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;)/&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;[Customs value]&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;), &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;YearMonth&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;),&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;YearMonth&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;) &lt;BR /&gt; &amp;lt; 0,'qmem://&amp;lt;bundled&amp;gt;/BuiltIn/arrow_s.png',)) //Is supposed to show an up arrow if the trendline goes up and a down arrow if the trendline goes down.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to achieve the following:&lt;/P&gt;&lt;P&gt;Show the up-arrow if the trendline for the line-chart goes up for the specific country of destination, and a down-arrow if the trendline goes down for the specific country of destination. This should disregard any selections in [Country of destination], so the arrow should also show when that country has not in the current selection. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only problem I (think I) am running into is with the &lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;LINEST_M&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;[Country of destination]&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; = &amp;gt;} &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;sum&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;[Customs duty paid]&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;)/&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;[Customs value]&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;), &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;YearMonth&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;),&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;YearMonth&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;)&lt;/SPAN&gt; part of the expression. It is doing something, but I’m fairly sure it’s not doing exactly what it’s supposed to. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone help me with this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please also see the attached example.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Apr 2016 10:46:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difficulty-with-Linest-m-combined-with-set-analysis-and-aggr/m-p/1067130#M356723</guid>
      <dc:creator />
      <dc:date>2016-04-20T10:46:04Z</dc:date>
    </item>
    <item>
      <title>Re: Difficulty with Linest_m combined with set analysis and aggr</title>
      <link>https://community.qlik.com/t5/QlikView/Difficulty-with-Linest-m-combined-with-set-analysis-and-aggr/m-p/1067131#M356724</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Anybody that can help here?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that the up/down arrows do not always correspond to the actual slope of the trendline or they even disappear when changing selections in YearMonth or [Country of destination], even if there is data available.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Apr 2016 09:18:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difficulty-with-Linest-m-combined-with-set-analysis-and-aggr/m-p/1067131#M356724</guid>
      <dc:creator />
      <dc:date>2016-04-21T09:18:25Z</dc:date>
    </item>
    <item>
      <title>Re: Difficulty with Linest_m combined with set analysis and aggr</title>
      <link>https://community.qlik.com/t5/QlikView/Difficulty-with-Linest-m-combined-with-set-analysis-and-aggr/m-p/1067132#M356725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I fixed it myself, such that the sign of the slope is generally correct. Changed the formula to:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;linest_M&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Country of destination]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Country of destination]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Customs duty paid]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) / &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Country of destination]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Customs value]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;YearMonth&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Country of destination]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;YearMonth&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This still gives a different outcome for the slope then what QV shows at the trendline, but this is because qlikview internally ranks the YearMonth field when calculating the trendline, and we are not allowed to do this in the Linest_M function. So basically, the trendline itself is calculated with X-values {1,2,3,...} and the linest_m function calculates it with X-values along the line of {42000,42030,42061,...} because of how dates are treated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So this solution is not perfect, but I believe it will do the job.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Apr 2016 12:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difficulty-with-Linest-m-combined-with-set-analysis-and-aggr/m-p/1067132#M356725</guid>
      <dc:creator />
      <dc:date>2016-04-21T12:16:04Z</dc:date>
    </item>
  </channel>
</rss>

