<?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: Group by conflicts in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Group-by-conflicts/m-p/108840#M17040</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333px;"&gt;Or another technique could be used if you have a time value in your Transaction infomation. Using &lt;SPAN style="font-family: 'courier new', courier;"&gt;FirsSortedValue()&lt;/SPAN&gt; can lift out all field values that belong to the last transaction.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LEFT JOIN(OriginalTransactions)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD Date,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FirstSortedValue(TransactionKey, -Time) AS TransactionKey, // Max(Time) as key also ok&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; True() AS ThisIsTheLastOne&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;FROM Source (Options)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;GROUP BY Date;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;There is only a small chance that you'll find time values in your table, but I'm just trying to make clear that you have to find a strict rule for assigning a transaction the status "Last". Load order or Display order may not work well...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Oct 2018 13:50:28 GMT</pubDate>
    <dc:creator>Peter_Cammaert</dc:creator>
    <dc:date>2018-10-16T13:50:28Z</dc:date>
    <item>
      <title>Group by conflicts</title>
      <link>https://community.qlik.com/t5/QlikView/Group-by-conflicts/m-p/108834#M17034</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'm trying to find the value from the field where date field has maximum value which I got easily using Group by function in the script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And now, for the same max date there are 3 different values (alphanumeric) are present out of which last value I want and set a flag against that value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am finding difficulties in achieving it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It would be helpful if someone throw lights on it .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank,&lt;/P&gt;&lt;P&gt;Prathip&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Oct 2018 12:53:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Group-by-conflicts/m-p/108834#M17034</guid>
      <dc:creator>prathipsrinivas</dc:creator>
      <dc:date>2018-10-16T12:53:42Z</dc:date>
    </item>
    <item>
      <title>Re: Group by conflicts</title>
      <link>https://community.qlik.com/t5/QlikView/Group-by-conflicts/m-p/108835#M17035</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can you elaborate on below. share your script sample output etc.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;And now, for the same max date there are 3 different values (alphanumeric) are present out of which last value I want and set a flag against that value.&lt;/P&gt;
&lt;P style="min-height: 8pt; padding: 0px;"&gt;&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Oct 2018 13:10:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Group-by-conflicts/m-p/108835#M17035</guid>
      <dc:creator>dplr-rn</dc:creator>
      <dc:date>2018-10-16T13:10:03Z</dc:date>
    </item>
    <item>
      <title>Re: Group by conflicts</title>
      <link>https://community.qlik.com/t5/QlikView/Group-by-conflicts/m-p/108836#M17036</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Prathip, it depends on how the data is sorted, if the last value is also the last value sorted alphabetically you can use MaxString(), in other case an easy way can be adding a RowNo() field and use this field to sort the table descending to retrieve the first record.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Oct 2018 13:29:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Group-by-conflicts/m-p/108836#M17036</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2018-10-16T13:29:46Z</dc:date>
    </item>
    <item>
      <title>Re: Group by conflicts</title>
      <link>https://community.qlik.com/t5/QlikView/Group-by-conflicts/m-p/108837#M17037</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeah Sure,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let's take an example &lt;/P&gt;&lt;P&gt;I have a max Date of Purchase: 12/10/2018&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in this date three transactions happened, whose TransactionKeys are&lt;/P&gt;&lt;P&gt;we12345 67ty&lt;/P&gt;&lt;P&gt;er34523 788hf&lt;/P&gt;&lt;P&gt;tr55678 453tr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here, i want last transactionkey. same way for all the purchases.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table looks something like this&lt;/P&gt;&lt;P&gt;purchase&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date&amp;nbsp;&amp;nbsp;&amp;nbsp; transactionkey&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 13.3333px;"&gt;12/10/2018&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; we12345 67ty&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 13.3333px;"&gt;12/10/2018&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;nbsp; &lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; er34523 788hf&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 13.3333px;"&gt;12/10/2018&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt; &lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tr55678 453tr&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Oct 2018 13:33:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Group-by-conflicts/m-p/108837#M17037</guid>
      <dc:creator>prathipsrinivas</dc:creator>
      <dc:date>2018-10-16T13:33:29Z</dc:date>
    </item>
    <item>
      <title>Re: Group by conflicts</title>
      <link>https://community.qlik.com/t5/QlikView/Group-by-conflicts/m-p/108838#M17038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your idea.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does Maxstring() works for alphanumeric fields?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And using RowNo(), can we use group by?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Very much Appreciated if you share any sample qvw.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Oct 2018 13:36:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Group-by-conflicts/m-p/108838#M17038</guid>
      <dc:creator>prathipsrinivas</dc:creator>
      <dc:date>2018-10-16T13:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: Group by conflicts</title>
      <link>https://community.qlik.com/t5/QlikView/Group-by-conflicts/m-p/108839#M17039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, Maxstring sorts alphanumeric, and Rowno can be used with group by. &lt;/P&gt;&lt;P&gt;To keep the last flagged record you can do a join with the max row number of the flagged records, like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:&lt;/P&gt;&lt;P&gt;LOAD*Inline [&lt;/P&gt;&lt;P&gt;purchase,date,transactionkey&lt;/P&gt;&lt;P&gt;1,12/10/2018,we12345 67ty&lt;/P&gt;&lt;P&gt;1,12/10/2018,er34523 788hf&lt;/P&gt;&lt;P&gt;1,12/10/2018,tr55678 453tr&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sorted:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD *, RowNo() as row Resident data;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Inner Join LOAD max(row) as row&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;// Where maxflag=1&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Resident Sorted;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop table data;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Oct 2018 13:45:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Group-by-conflicts/m-p/108839#M17039</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2018-10-16T13:45:43Z</dc:date>
    </item>
    <item>
      <title>Re: Group by conflicts</title>
      <link>https://community.qlik.com/t5/QlikView/Group-by-conflicts/m-p/108840#M17040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333px;"&gt;Or another technique could be used if you have a time value in your Transaction infomation. Using &lt;SPAN style="font-family: 'courier new', courier;"&gt;FirsSortedValue()&lt;/SPAN&gt; can lift out all field values that belong to the last transaction.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LEFT JOIN(OriginalTransactions)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD Date,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FirstSortedValue(TransactionKey, -Time) AS TransactionKey, // Max(Time) as key also ok&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; True() AS ThisIsTheLastOne&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;FROM Source (Options)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;GROUP BY Date;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;There is only a small chance that you'll find time values in your table, but I'm just trying to make clear that you have to find a strict rule for assigning a transaction the status "Last". Load order or Display order may not work well...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Oct 2018 13:50:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Group-by-conflicts/m-p/108840#M17040</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2018-10-16T13:50:28Z</dc:date>
    </item>
    <item>
      <title>Re: Group by conflicts</title>
      <link>https://community.qlik.com/t5/QlikView/Group-by-conflicts/m-p/108841#M17041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a Lot Ruben,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maxstring seems to be working.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Oct 2018 14:01:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Group-by-conflicts/m-p/108841#M17041</guid>
      <dc:creator>prathipsrinivas</dc:creator>
      <dc:date>2018-10-16T14:01:39Z</dc:date>
    </item>
  </channel>
</rss>

