<?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: Creating new field in script based on other fields grouped by order number in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Creating-new-field-in-script-based-on-other-fields-grouped-by/m-p/36208#M785193</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I may be wrong, but seems like you just need this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DataTMP:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD [Order Number], &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Line Number], &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Line Type], &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Invoice Date], &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Order Item Cancel Date], &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Quantity Ordered - 9L],&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #ff0000;"&gt;Alt([Invoice Date] ,[Order Item Cancel Date]) as [Case Fill Date]&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FROM Sample.xls&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(biff, embedded labels, table is Sheet1$);&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Mar 2018 12:06:34 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2018-03-16T12:06:34Z</dc:date>
    <item>
      <title>Creating new field in script based on other fields grouped by order number</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-new-field-in-script-based-on-other-fields-grouped-by/m-p/36202#M785187</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 can't seem to get this formula correct, what i want is to create a new field based on some date fields.&lt;/P&gt;&lt;P&gt;so the logic would be..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="x_MsoNormal" style="font-size: 11pt; font-family: Calibri, sans-serif; color: #212121;"&gt;If there are only [order item cancel date]s at the line item level then [case fill date] = MAX([order item cancel date])&lt;/P&gt;&lt;P class="x_MsoNormal" style="font-size: 11pt; font-family: Calibri, sans-serif; color: #212121;"&gt;If there are only [invoice date]s at the line item level then [case fill date] = MAX([invoice date])&lt;/P&gt;&lt;P class="x_MsoNormal" style="font-size: 11pt; font-family: Calibri, sans-serif; color: #212121;"&gt;If there are a mix of [order item cancel date]s and [invoice date]s the [case fill date] = MAX([invoice date])&lt;/P&gt;&lt;P class="x_MsoNormal" style="font-size: 11pt; font-family: Calibri, sans-serif; color: #212121;"&gt;If there are neither [order item cancel date]s or [invoice date]s then [case fill date] = NULL&lt;/P&gt;&lt;P class="x_MsoNormal" style="font-size: 11pt; font-family: Calibri, sans-serif; color: #212121;"&gt;&lt;/P&gt;&lt;P class="x_MsoNormal" style="font-size: 11pt; font-family: Calibri, sans-serif; color: #212121;"&gt;can anyone point me in the right direction please?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-new-field-in-script-based-on-other-fields-grouped-by/m-p/36202#M785187</guid>
      <dc:creator>hopkinsc</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Creating new field in script based on other fields grouped by order number</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-new-field-in-script-based-on-other-fields-grouped-by/m-p/36203#M785188</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have just updated the sample files with what i have working so far. &lt;/P&gt;&lt;P&gt;as you can see from the selections, i have one order number selected and it has 2 different Invoice Dates. i can get the new field to show these Invoice dates but i want the new field to only show the max invoice date for the whole order. so for the order selected i would want 27/10/2015 to be against all line items. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Mar 2018 16:51:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-new-field-in-script-based-on-other-fields-grouped-by/m-p/36203#M785188</guid>
      <dc:creator>hopkinsc</dc:creator>
      <dc:date>2018-03-15T16:51:08Z</dc:date>
    </item>
    <item>
      <title>Re: Creating new field in script based on other fields grouped by order number</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-new-field-in-script-based-on-other-fields-grouped-by/m-p/36204#M785189</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;MaxDates:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;Lineno&lt;/P&gt;&lt;P&gt;Max (canceldate) as canceldate&lt;/P&gt;&lt;P&gt;Max (invoicedate)as invoivedate&lt;/P&gt;&lt;P&gt;Resident LineTable&lt;/P&gt;&lt;P&gt;Group by lineno;&lt;/P&gt;&lt;P&gt;Map_cancelDate:&lt;/P&gt;&lt;P&gt;Mapping load&lt;/P&gt;&lt;P&gt;Lineno, &lt;/P&gt;&lt;P&gt;Canceldate&lt;/P&gt;&lt;P&gt;Resident MaxDates;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Map_InvoiceDate:&lt;/P&gt;&lt;P&gt;Mapping load&lt;/P&gt;&lt;P&gt;Lineno, &lt;/P&gt;&lt;P&gt;Invoicedate&lt;/P&gt;&lt;P&gt;Resident MaxDates;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FinalTable:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;Lineno,&lt;/P&gt;&lt;P&gt;If yourflag conditions&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;Lineno,&lt;/P&gt;&lt;P&gt;Applymap ('&lt;SPAN style="font-size: 13.3333px;"&gt;Map_InvoiceDate',lineno,Null ())&amp;nbsp; as maxinvoicedate,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Applymap ('&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Map_CancelDate',lineno,Null ())&amp;nbsp; as maxCanceldate,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Casefilldate&lt;/P&gt;&lt;P&gt;Resident linetable;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Mar 2018 16:53:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-new-field-in-script-based-on-other-fields-grouped-by/m-p/36204#M785189</guid>
      <dc:creator>sasiparupudi1</dc:creator>
      <dc:date>2018-03-15T16:53:36Z</dc:date>
    </item>
    <item>
      <title>Re: Creating new field in script based on other fields grouped by order number</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-new-field-in-script-based-on-other-fields-grouped-by/m-p/36205#M785190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, thanks for your reply, but unfortunately i cannot get this working..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Mar 2018 17:23:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-new-field-in-script-based-on-other-fields-grouped-by/m-p/36205#M785190</guid>
      <dc:creator>hopkinsc</dc:creator>
      <dc:date>2018-03-15T17:23:57Z</dc:date>
    </item>
    <item>
      <title>Re: Creating new field in script based on other fields grouped by order number</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-new-field-in-script-based-on-other-fields-grouped-by/m-p/36206#M785191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Hi Chris!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;try this...&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;load *,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(not isnull([Order Item Cancel Date]) and not isnull([Invoice Date]) or isnull([Invoice Date]) and isnull([Order Item Cancel Date]),&amp;nbsp; date(max([Invoice Date])),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt; if(not isnull([Order Item Cancel Date]) and isnull([Invoice Date]), date(max([Order Item Cancel Date])), &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt; if(isnull([Order Item Cancel Date]) and not isnull([Invoice Date]), date(max([Invoice Date])),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; null()))) as newfield&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Mar 2018 21:23:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-new-field-in-script-based-on-other-fields-grouped-by/m-p/36206#M785191</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-03-15T21:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: Creating new field in script based on other fields grouped by order number</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-new-field-in-script-based-on-other-fields-grouped-by/m-p/36207#M785192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can't get this working either. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2018 11:20:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-new-field-in-script-based-on-other-fields-grouped-by/m-p/36207#M785192</guid>
      <dc:creator>hopkinsc</dc:creator>
      <dc:date>2018-03-16T11:20:17Z</dc:date>
    </item>
    <item>
      <title>Re: Creating new field in script based on other fields grouped by order number</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-new-field-in-script-based-on-other-fields-grouped-by/m-p/36208#M785193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I may be wrong, but seems like you just need this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DataTMP:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD [Order Number], &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Line Number], &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Line Type], &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Invoice Date], &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Order Item Cancel Date], &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Quantity Ordered - 9L],&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #ff0000;"&gt;Alt([Invoice Date] ,[Order Item Cancel Date]) as [Case Fill Date]&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FROM Sample.xls&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(biff, embedded labels, table is Sheet1$);&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2018 12:06:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-new-field-in-script-based-on-other-fields-grouped-by/m-p/36208#M785193</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-03-16T12:06:34Z</dc:date>
    </item>
    <item>
      <title>Re: Creating new field in script based on other fields grouped by order number</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-new-field-in-script-based-on-other-fields-grouped-by/m-p/36209#M785194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;that would work for most of the orders, but for example, if i select the order number 15001624, there are 2 different invoice dates, so i would need the max invoice date&amp;nbsp; applied to them all and it would be the same if there were multiple cancel dates per order - i would need the max cancel date against all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/196570_Capture.JPG" style="height: 107px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;does that make sense?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2018 12:22:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-new-field-in-script-based-on-other-fields-grouped-by/m-p/36209#M785194</guid>
      <dc:creator>hopkinsc</dc:creator>
      <dc:date>2018-03-16T12:22:26Z</dc:date>
    </item>
    <item>
      <title>Re: Creating new field in script based on other fields grouped by order number</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-new-field-in-script-based-on-other-fields-grouped-by/m-p/36210#M785195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;DataTMP:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;LOAD [Order Number], &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Line Number], &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Line Type], &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Invoice Date], &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Order Item Cancel Date], &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Quantity Ordered - 9L]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;FROM Sample.xls&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;(biff, embedded labels, table is Sheet1$);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;Left Join (DataTMP)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;LOAD [Order Number],&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt; Date(Max(Alt([Invoice Date] ,[Order Item Cancel Date]))) as [Case Fill Date]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;Resident DataTMP&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;Group By [Order Number];&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/196575_Capture.PNG" style="height: 319px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2018 12:27:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-new-field-in-script-based-on-other-fields-grouped-by/m-p/36210#M785195</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-03-16T12:27:15Z</dc:date>
    </item>
    <item>
      <title>Re: Creating new field in script based on other fields grouped by order number</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-new-field-in-script-based-on-other-fields-grouped-by/m-p/36211#M785196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;perfect! thanks Sunny!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2018 12:33:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-new-field-in-script-based-on-other-fields-grouped-by/m-p/36211#M785196</guid>
      <dc:creator>hopkinsc</dc:creator>
      <dc:date>2018-03-16T12:33:18Z</dc:date>
    </item>
  </channel>
</rss>

