<?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: add calculated field to interval match in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/add-calculated-field-to-interval-match/m-p/1299127#M619054</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haven't used join before.&amp;nbsp; so could you just help me understand it a bit. Let's say i want to create a field called Margin.&amp;nbsp; where it takes sales / markup?&amp;nbsp; where would i then put it in the script?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Apr 2017 11:02:17 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-04-18T11:02:17Z</dc:date>
    <item>
      <title>add calculated field to interval match</title>
      <link>https://community.qlik.com/t5/QlikView/add-calculated-field-to-interval-match/m-p/1299125#M619046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the following code.&amp;nbsp; which are looking up a tax percentage based on the invoice date. This tax i need to deduct from the cost.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Rates:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Directory;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Mapping LOAD&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Company,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Rate_GBP&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FROM&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;[Basedata\Exchange Rates.xlsx]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(ooxml, embedded labels, table is Sheet1);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sales:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; InvNumber,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; InvoiceDate as CalendarDate,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; InvMonth,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; InvYear,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Company,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; OrderNumber,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; OrderType,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; OrderLineNumber,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; OrderDate,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &lt;/STRONG&gt;&lt;STRONG&gt;&amp;nbsp; SellToCustomer,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &lt;/STRONG&gt;&lt;STRONG style="font-size: 10pt;"&gt;&amp;nbsp; ItemNumber,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &lt;/STRONG&gt;&lt;STRONG style="font-size: 10pt;"&gt;&amp;nbsp; NettLocal as [Sales LCY AC],&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; NettLocal / ApplyMap('Rates', Company, 0) as [Sales GBP AC],&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &lt;/STRONG&gt;&lt;STRONG style="font-size: 10pt;"&gt;&amp;nbsp; OrderCurrency,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &lt;/STRONG&gt;&lt;STRONG style="font-size: 10pt;"&gt;&amp;nbsp; &lt;/STRONG&gt;&lt;STRONG&gt;Cost,&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;STRONG style="font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #ff0000;"&gt;([Cost]/&lt;STRONG style="font-size: 13.3333px;"&gt;[Markup Percentage]&lt;/STRONG&gt;) as [Cost without tax],&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;STRONG style="color: #ff0000; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Nettlocal - cost without tax&amp;nbsp; as margin&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;STRONG style="color: #ff0000; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; more stuff with the cost without tax.&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;STRONG style="font-size: 10pt;"&gt;[Local Curr]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FROM&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;[Sales.qvd]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(qvd) Where Len(InvNumber)&amp;gt;0;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Intervals:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Collroll_From,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Collroll_To,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Markup Percentage],&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CR_Company,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CR_Country,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CR_Country &amp;amp;'-'&amp;amp; Collroll_From as [Costroll Name]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FROM&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;[Markup Intervals - DK TEST.xlsx]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(ooxml, embedded labels, table is Sheet1);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;IntervalMatch:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;IntervalMatch (CalendarDate)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Load distinct Collroll_From, Collroll_To resident Intervals;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Right now i'm doing it this way. (without the red text).&amp;nbsp; this will calculate the correct amounts if i add enough dimensions. But it's only right per line in a straight table. not the totals etc. &lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;STRONG&gt; =sum({$&amp;lt;CalendarYear = {$(=max(CalendarYear))}&amp;gt;} [Sales LCY AC])- &lt;/STRONG&gt;&lt;STRONG&gt; (sum({$&amp;lt;CalendarYear = {$(=max(CalendarYear))}&amp;gt;} [cost])/ &lt;/STRONG&gt;&lt;STRONG&gt;sum({$&amp;lt;CalendarYear = {$(=max(CalendarYear))}&amp;gt;} [Markup Percentage]))&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;It's not really working as intended.&amp;nbsp; Also i'm having more problems with it.&amp;nbsp; I need further fields in the load script, to simplify the formulas.&amp;nbsp; So i'm thinking I need to create the Red lines in the load script.&amp;nbsp; which would make it possible to sum on that one field. and not create it by dividing subtracting etc. in the charts.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;But my problem are i want to load the fields in the sales table, but this is not possible since the markup aren't interval match before the sales load are done.&amp;nbsp; so how would i achieve this?&amp;nbsp; Also to complex it a bit. I need to add the country to the interval match. right now i'm only testing with 1 country.&amp;nbsp; But in fact i have 4 countries, with different tax'es and different dates. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Should I drop the interval match and go another way? or how can i move forward.&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Apr 2017 07:55:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/add-calculated-field-to-interval-match/m-p/1299125#M619046</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-04-11T07:55:32Z</dc:date>
    </item>
    <item>
      <title>Re: add calculated field to interval match</title>
      <link>https://community.qlik.com/t5/QlikView/add-calculated-field-to-interval-match/m-p/1299126#M619048</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Mike,&lt;/P&gt;&lt;P&gt;If my understanding is correct, you would want to use the field &lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;[Markup Percentage]&lt;/STRONG&gt; in Sales table to calculate new fields marked in red.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could use Extended Interval Match to bring in the Fields from Intervals table into Sales table. I have included Country level to intervals so use can match this to your script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Intervals:&lt;/P&gt;&lt;P&gt;Load * Inline&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;Collroll_From,Collroll_To,Markup Percentage,Country&lt;/P&gt;&lt;P&gt;01/01/2017,31/01/2017,30,US&lt;/P&gt;&lt;P&gt;01/02/2017,28/02/2017,25,US&lt;/P&gt;&lt;P&gt;01/03/2017,31/03/2017,15,US&lt;/P&gt;&lt;P&gt;01/04/2017,30/04/2017,32,US&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sales:&lt;/P&gt;&lt;P&gt;Load * Inline&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;InvoiceNo,CalendarDate,Cost,Country&lt;/P&gt;&lt;P&gt;111,10/01/2017,200,US&lt;/P&gt;&lt;P&gt;112,02/02/2017,350,US&lt;/P&gt;&lt;P&gt;113,21/03/2017,400,US&lt;/P&gt;&lt;P&gt;114,11/04/2017,120,US&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left Join IntervalMatch(CalendarDate,Country)&lt;/P&gt;&lt;P&gt;Load Collroll_From,Collroll_To,Country Resident Intervals;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left Join(Sales)&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;Collroll_From,Collroll_To,[Markup Percentage],Country&lt;/P&gt;&lt;P&gt;Resident Intervals;&lt;/P&gt;&lt;P&gt;Drop Table Intervals;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attached is the sample application for the same&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Apr 2017 14:56:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/add-calculated-field-to-interval-match/m-p/1299126#M619048</guid>
      <dc:creator>malini_qlikview</dc:creator>
      <dc:date>2017-04-11T14:56:12Z</dc:date>
    </item>
    <item>
      <title>Re: add calculated field to interval match</title>
      <link>https://community.qlik.com/t5/QlikView/add-calculated-field-to-interval-match/m-p/1299127#M619054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haven't used join before.&amp;nbsp; so could you just help me understand it a bit. Let's say i want to create a field called Margin.&amp;nbsp; where it takes sales / markup?&amp;nbsp; where would i then put it in the script?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Apr 2017 11:02:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/add-calculated-field-to-interval-match/m-p/1299127#M619054</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-04-18T11:02:17Z</dc:date>
    </item>
  </channel>
</rss>

