<?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 order by and FieldValue in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/order-by-and-FieldValue/m-p/251402#M95368</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I got a table sorted as follows:&lt;/P&gt;&lt;P&gt;Item_id asc, Sale_Date desc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if i preview the table in the table viewer I get first the item id 26 repeated several times depending on the number of transactions&lt;/P&gt;&lt;P&gt;However now I'm applying a loop as follows:&lt;/P&gt;&lt;P&gt;let vRecords = NoOfrows('myTable');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for i=1 to $(vRecords)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; let x = FieldValue('Item_id',$(i))&lt;/P&gt;&lt;P&gt;next&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if I debug the script I get the first item to be 3294 which is not 26 as I'm seeing it in the previewer&lt;/P&gt;&lt;P&gt;what could be the problem?&lt;/P&gt;&lt;P&gt;please Advise&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Nov 2011 14:49:37 GMT</pubDate>
    <dc:creator>ali_hijazi</dc:creator>
    <dc:date>2011-11-23T14:49:37Z</dc:date>
    <item>
      <title>order by and FieldValue</title>
      <link>https://community.qlik.com/t5/QlikView/order-by-and-FieldValue/m-p/251402#M95368</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I got a table sorted as follows:&lt;/P&gt;&lt;P&gt;Item_id asc, Sale_Date desc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if i preview the table in the table viewer I get first the item id 26 repeated several times depending on the number of transactions&lt;/P&gt;&lt;P&gt;However now I'm applying a loop as follows:&lt;/P&gt;&lt;P&gt;let vRecords = NoOfrows('myTable');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for i=1 to $(vRecords)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; let x = FieldValue('Item_id',$(i))&lt;/P&gt;&lt;P&gt;next&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if I debug the script I get the first item to be 3294 which is not 26 as I'm seeing it in the previewer&lt;/P&gt;&lt;P&gt;what could be the problem?&lt;/P&gt;&lt;P&gt;please Advise&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Nov 2011 14:49:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/order-by-and-FieldValue/m-p/251402#M95368</guid>
      <dc:creator>ali_hijazi</dc:creator>
      <dc:date>2011-11-23T14:49:37Z</dc:date>
    </item>
    <item>
      <title>order by and FieldValue</title>
      <link>https://community.qlik.com/t5/QlikView/order-by-and-FieldValue/m-p/251403#M95369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;FieldValue will access the internally stored compressed Field with index given by unique value in load order.&lt;/P&gt;&lt;P&gt;That could explain the difference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try using peek() function instead:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for i=0 to $(vRecords)-1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; let x = Peek('item_id',$(i),'myTable')&lt;/P&gt;&lt;P&gt;next&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Nov 2011 14:58:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/order-by-and-FieldValue/m-p/251403#M95369</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-11-23T14:58:26Z</dc:date>
    </item>
  </channel>
</rss>

