<?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: Fieldvalue or Firstsortedvalue instead of LEFT JOIN in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Fieldvalue-or-Firstsortedvalue-instead-of-LEFT-JOIN/m-p/744973#M663326</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Hi Henric, I would like to avoid joins but in this case the &lt;SPAN style="color: #000000; font-family: 'Courier New'; font-size: 12px;"&gt;MaxSalesFactId will just generate one value for one &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;%D_CONTRACT_ID (Agreement) right? I need the max value for each &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;%D_CONTRACT_ID, so if I do a group by &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;%D_CONTRACT_ID it will be provided. But then I can't use variables right?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Johan&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;--------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;You should avoid the joins.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;The script below does the same - I think.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;HIC&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: green;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: green;"&gt;// Find highest SalesFactID&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;MaxSalesFactId:&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN lang="EN-US" style="font-weight: inherit; font-style: inherit; font-size: 9pt; font-family: 'Courier New'; color: blue;"&gt;LOAD&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt; &lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: blue;"&gt;max&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: maroon;"&gt;SalesFactId&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;) &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: blue;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt; &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: maroon;"&gt;MaxSalesFactId&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt; &lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: blue;"&gt;FROM&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt; SALES_FACT.qvd (&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: blue;"&gt;qvd&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;)&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: blue;"&gt;Where&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt; &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: maroon;"&gt;EventTypeCd&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt; = 'INSURANCEOFFER';&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN lang="EN-US" style="font-weight: inherit; font-style: inherit; font-size: 9pt; font-family: 'Courier New'; color: blue;"&gt;Let&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt; &lt;/SPAN&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;&lt;SPAN lang="EN-US" style="font-weight: inherit; font-style: inherit; font-size: 9pt; font-family: 'Courier New'; color: gray;"&gt;vMaxSalesFactId&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt; = &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: blue;"&gt;Peek&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;('MaxSalesFactId',-1,'MaxSalesFactId');&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Feb 2015 10:25:43 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-02-19T10:25:43Z</dc:date>
    <item>
      <title>Fieldvalue or Firstsortedvalue instead of LEFT JOIN</title>
      <link>https://community.qlik.com/t5/QlikView/Fieldvalue-or-Firstsortedvalue-instead-of-LEFT-JOIN/m-p/744971#M663324</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to optimize my transformation and would appreciate some pointers how to approach this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I'm aiming for is to make this quicker in QV and I would like to have all logic in the transformation layer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SALES_FACT:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; num(SalesFactId) AS %SalesFactId, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*Dimension ID*/ &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; num(D_CONTRACT_ID) AS %D_CONTRACT_ID, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; num(DATE#(D_EVENT_DATE_ID,'YYYYMMDD')) AS %D_EVENT_DATE_ID, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(EventTypeCd = 'INSURANCEANNULATED', 1,0) AS FlagINSURANCEANNULATED,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(EventTypeCd = 'INSURANCECANCELLED', 1,0) AS FlagINSURANCECANCELLED,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(EventTypeCd = 'INSURANCEOFFER', 1,0) AS FlagTempINSURANCEOFFER,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(EventTypeCd = 'INSURANCESOLD', 1,0) AS FlagTempINSURANCESOLD,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(MATCH([CustomerFeedback], 'DECLINED', 'ACCEPTED', 'NEVER'),1,0) AS FlagCustomerFeedbackNoCallingList, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;FROM&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SALES_FACT.qvd (qvd);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LEFT JOIN (SALES_FACT)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD %SalesFactId,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 as FlagNoCallingList&lt;/P&gt;&lt;P&gt;RESIDENT SALES_FACT&lt;/P&gt;&lt;P&gt;WHERE &lt;/P&gt;&lt;P&gt;FlagCustomerFeedbackNoCallingList = 1 OR FlagTempINSURANCESOLD = 1 OR FlagINSURANCEANNULATED = 1 OR FlagINSURANCECANCELLED = 1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LEFT JOIN (SALES_FACT)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD max(%SalesFactId) AS %SalesFactId,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 as FlagINSURANCEOFFER&lt;/P&gt;&lt;P&gt;RESIDENT SALES_FACT&lt;/P&gt;&lt;P&gt;where FlagTempINSURANCEOFFER = 1&lt;/P&gt;&lt;P&gt;group by %D_CONTRACT_ID;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The reason for creating FlagNoCallingList is to use one simple set analysis in the dashboard to exclude those contracts that have &lt;SPAN style="font-size: 13.3333330154419px;"&gt;FlagNoCallingList = 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;LOAD max(%SalesFactId) AS %SalesFactId,&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 as FlagINSURANCEOFFER&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;RESIDENT SALES_FACT&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;where FlagTempINSURANCEOFFER = 1&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;group by %D_CONTRACT_ID;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;is because we have duplicates in the source table (we are working on removing these) and I always want the latest record for &lt;SPAN style="font-size: 13.3333330154419px;"&gt;FlagTempINSURANCEOFFER for each &lt;SPAN style="font-size: 13.3333330154419px;"&gt;%D_CONTRACT_ID.&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;So is it possible to replace these logic with smarter scripting in QV.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe: &lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;&amp;nbsp; aggr(max(fieldvalue('%SalesFactId', recno())),%D_CONTRACT_ID)&amp;nbsp; &lt;/P&gt;&lt;P&gt;AutoGenerate FieldValueCount('&lt;SPAN style="font-size: 13.3333330154419px;"&gt;%SalesFactId&lt;/SPAN&gt;');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIRSTSORTEDVALUE (??, aggr(max(%&lt;SPAN style="font-size: 13.3333330154419px;"&gt;SalesFactId&lt;/SPAN&gt;),&lt;SPAN style="font-size: 13.3333330154419px;"&gt;%D_CONTRACT_ID&lt;/SPAN&gt;) )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Br Johan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Feb 2015 14:22:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Fieldvalue-or-Firstsortedvalue-instead-of-LEFT-JOIN/m-p/744971#M663324</guid>
      <dc:creator />
      <dc:date>2015-02-18T14:22:21Z</dc:date>
    </item>
    <item>
      <title>Re: Fieldvalue or Firstsortedvalue instead of LEFT JOIN</title>
      <link>https://community.qlik.com/t5/QlikView/Fieldvalue-or-Firstsortedvalue-instead-of-LEFT-JOIN/m-p/744972#M663325</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should avoid the joins.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The script below does the same - I think.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HIC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: green;"&gt;// Find highest SalesFactID&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;MaxSalesFactId:&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;LOAD&lt;/SPAN&gt;&lt;/STRONG&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;max&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;SalesFactId&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;AS&lt;/SPAN&gt; &lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;MaxSalesFactId&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;FROM&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; SALES_FACT.qvd (&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;qvd&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;Where&lt;/SPAN&gt; &lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;EventTypeCd&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; = 'INSURANCEOFFER';&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;Let&lt;/SPAN&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;EM&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: gray;"&gt;vMaxSalesFactId&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&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;Peek&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;('MaxSalesFactId',-1,'MaxSalesFactId');&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: green;"&gt;//Load Fact table &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;SALES_FACT:&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;Load&lt;/SPAN&gt;&lt;/STRONG&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;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: maroon;"&gt;%SalesFactId&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; = &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: gray;"&gt;$(vMaxSalesFactId)&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;,1,0) &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;FlagINSURANCEOFFER&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;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: maroon;"&gt;FlagCustomerFeedbackNoCallingList&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; = 1 &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;OR&lt;/SPAN&gt; &lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;FlagTempINSURANCESOLD&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; = 1 &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;OR&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: maroon;"&gt;FlagINSURANCEANNULATED&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; = 1 &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;OR&lt;/SPAN&gt; &lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;FlagINSURANCECANCELLED&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; = 1,&lt;BR /&gt; 1, 0) &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;FlagNoCallingList&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;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;LOAD&lt;/SPAN&gt;&lt;/STRONG&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;num&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;SalesFactId&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;AS&lt;/SPAN&gt; &lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;%SalesFactId&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: green;"&gt;/*Dimension ID*/&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;num&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;D_CONTRACT_ID&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;AS&lt;/SPAN&gt; &lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;%D_CONTRACT_ID&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;num&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;DATE#&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;D_EVENT_DATE_ID&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;,'YYYYMMDD')) &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;AS&lt;/SPAN&gt; &lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;%D_EVENT_DATE_ID&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;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: maroon;"&gt;EventTypeCd&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; = 'INSURANCEANNULATED', 1,0) &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;AS&lt;/SPAN&gt; &lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;FlagINSURANCEANNULATED&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;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: maroon;"&gt;EventTypeCd&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; = 'INSURANCECANCELLED', 1,0) &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;AS&lt;/SPAN&gt; &lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;FlagINSURANCECANCELLED&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;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: maroon;"&gt;EventTypeCd&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; = 'INSURANCEOFFER', 1,0) &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;AS&lt;/SPAN&gt; &lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;FlagTempINSURANCEOFFER&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;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: maroon;"&gt;EventTypeCd&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; = 'INSURANCESOLD', 1,0) &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;AS&lt;/SPAN&gt; &lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;FlagTempINSURANCESOLD&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;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;MATCH&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;[CustomerFeedback]&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;, 'DECLINED', 'ACCEPTED', 'NEVER'),1,0) &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;AS&lt;/SPAN&gt; &lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;FlagCustomerFeedbackNoCallingList&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: maroon;"&gt;FROM&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; SALES_FACT.qvd (qvd); &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Feb 2015 14:37:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Fieldvalue-or-Firstsortedvalue-instead-of-LEFT-JOIN/m-p/744972#M663325</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2015-02-18T14:37:41Z</dc:date>
    </item>
    <item>
      <title>Re: Fieldvalue or Firstsortedvalue instead of LEFT JOIN</title>
      <link>https://community.qlik.com/t5/QlikView/Fieldvalue-or-Firstsortedvalue-instead-of-LEFT-JOIN/m-p/744973#M663326</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Hi Henric, I would like to avoid joins but in this case the &lt;SPAN style="color: #000000; font-family: 'Courier New'; font-size: 12px;"&gt;MaxSalesFactId will just generate one value for one &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;%D_CONTRACT_ID (Agreement) right? I need the max value for each &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;%D_CONTRACT_ID, so if I do a group by &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;%D_CONTRACT_ID it will be provided. But then I can't use variables right?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Johan&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;--------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;You should avoid the joins.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;The script below does the same - I think.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;HIC&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: green;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: green;"&gt;// Find highest SalesFactID&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;MaxSalesFactId:&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN lang="EN-US" style="font-weight: inherit; font-style: inherit; font-size: 9pt; font-family: 'Courier New'; color: blue;"&gt;LOAD&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt; &lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: blue;"&gt;max&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: maroon;"&gt;SalesFactId&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;) &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: blue;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt; &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: maroon;"&gt;MaxSalesFactId&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt; &lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: blue;"&gt;FROM&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt; SALES_FACT.qvd (&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: blue;"&gt;qvd&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;)&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: blue;"&gt;Where&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt; &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: maroon;"&gt;EventTypeCd&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt; = 'INSURANCEOFFER';&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN lang="EN-US" style="font-weight: inherit; font-style: inherit; font-size: 9pt; font-family: 'Courier New'; color: blue;"&gt;Let&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt; &lt;/SPAN&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;&lt;SPAN lang="EN-US" style="font-weight: inherit; font-style: inherit; font-size: 9pt; font-family: 'Courier New'; color: gray;"&gt;vMaxSalesFactId&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt; = &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: blue;"&gt;Peek&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;('MaxSalesFactId',-1,'MaxSalesFactId');&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Feb 2015 10:25:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Fieldvalue-or-Firstsortedvalue-instead-of-LEFT-JOIN/m-p/744973#M663326</guid>
      <dc:creator />
      <dc:date>2015-02-19T10:25:43Z</dc:date>
    </item>
    <item>
      <title>Re: Fieldvalue or Firstsortedvalue instead of LEFT JOIN</title>
      <link>https://community.qlik.com/t5/QlikView/Fieldvalue-or-Firstsortedvalue-instead-of-LEFT-JOIN/m-p/744974#M663327</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want the max value for each ContractID, then you can use a join, yes. A variable can only have one value. But then you need ContractID as key in your table - which you don't in your example above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333330154419px;"&gt;&lt;STRONG&gt;%D_CONTRACT_ID,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333330154419px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Max(%SalesFactId) AS %SalesFactId,&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 as FlagINSURANCEOFFER&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RESIDENT SALES_FACT&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where FlagTempINSURANCEOFFER = 1&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; group by %D_CONTRACT_ID;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Feb 2015 13:25:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Fieldvalue-or-Firstsortedvalue-instead-of-LEFT-JOIN/m-p/744974#M663327</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2015-02-19T13:25:55Z</dc:date>
    </item>
  </channel>
</rss>

