<?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 looping through all rows in a transactiontable with a macro in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/looping-through-all-rows-in-a-transactiontable-with-a-macro/m-p/188448#M51693</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Consider adding a unique rownumber to the transaction table, then create a tablebox with all the 4 fields. Rownumber as the 4th column.&lt;BR /&gt;This will now show all 6 rows.&lt;BR /&gt;Then use the following macro to loop through the rows (excluding the 4th column with the rownumber).&lt;BR /&gt;I would also use a different separator since the itemNo field has - characters in it.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;sub test&lt;BR /&gt;set TableBox = ActiveDocument.GetSheetObject( "TB01" )&lt;BR /&gt;for RowIter = 1 to TableBox.GetRowCount-1&lt;BR /&gt; concatText = ""&lt;BR /&gt; for ColIter =0 to TableBox.GetColumnCount-2 'Don't include the last column (row)&lt;BR /&gt; set cell = TableBox.GetCell(RowIter,ColIter)&lt;BR /&gt; concatText = concatText + cell.Text + ";"&lt;BR /&gt; next&lt;BR /&gt; concatText = left(concatText, len(concatText)-1) ' Remove the trailing ;&lt;BR /&gt; msgbox(concatText)&lt;BR /&gt;next&lt;BR /&gt;end sub&lt;/P&gt;&lt;P&gt;Hope it's what you we're looking for.&lt;/P&gt;&lt;P&gt;/Fredrik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 Dec 2009 23:40:00 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-12-16T23:40:00Z</dc:date>
    <item>
      <title>looping through all rows in a transactiontable with a macro</title>
      <link>https://community.qlik.com/t5/QlikView/looping-through-all-rows-in-a-transactiontable-with-a-macro/m-p/188447#M51692</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a transaction table containing theese records:&lt;/P&gt;&lt;P&gt;(Sorry for bad formating)&lt;/P&gt;&lt;P&gt;period lime_itemno lime_qty&lt;BR /&gt;1 66-HRG22-1 267&lt;BR /&gt;2 42-JRD22-1 267&lt;BR /&gt;2 42-DRGGR-1 800&lt;BR /&gt;3 42-RRE2-1 267&lt;BR /&gt;3 42-DRG6-1 100&lt;BR /&gt;3 42-DRG6-1 100&lt;/P&gt;&lt;P&gt;How do i write a macro that steps through all theese rows, one by one? As you can see, some rows are duplicated, but I still concider theese rows to be unique and I want to step through theese as well.&lt;/P&gt;&lt;P&gt;I've tried this:&lt;/P&gt;&lt;P&gt;sub test&lt;BR /&gt; set period = ActiveDocument.Fields("trans_period").GetPossibleValues(100000)&lt;BR /&gt; for i = 0 to period.count -1&lt;BR /&gt; set itemno = ActiveDocument.Fields("lime_itemno").GetPossibleValues(100000)&lt;BR /&gt; for j = 0 to itemno.count -1&lt;BR /&gt; set qty = ActiveDocument.Fields("lime_qty").GetPossibleValues(100000)&lt;BR /&gt; for k = 0 to qty.count -1&lt;BR /&gt; msgbox period(i).text + "-" + itemno(j).text + "-" + qty(k).text&lt;BR /&gt; next&lt;BR /&gt; next&lt;BR /&gt; next&lt;BR /&gt;end sub&lt;/P&gt;&lt;P&gt;But that don't work, since I get too many messageboxes, one for each unique combination of all three columns.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;/ Robert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Dec 2009 22:50:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/looping-through-all-rows-in-a-transactiontable-with-a-macro/m-p/188447#M51692</guid>
      <dc:creator />
      <dc:date>2009-12-15T22:50:54Z</dc:date>
    </item>
    <item>
      <title>looping through all rows in a transactiontable with a macro</title>
      <link>https://community.qlik.com/t5/QlikView/looping-through-all-rows-in-a-transactiontable-with-a-macro/m-p/188448#M51693</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Consider adding a unique rownumber to the transaction table, then create a tablebox with all the 4 fields. Rownumber as the 4th column.&lt;BR /&gt;This will now show all 6 rows.&lt;BR /&gt;Then use the following macro to loop through the rows (excluding the 4th column with the rownumber).&lt;BR /&gt;I would also use a different separator since the itemNo field has - characters in it.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;sub test&lt;BR /&gt;set TableBox = ActiveDocument.GetSheetObject( "TB01" )&lt;BR /&gt;for RowIter = 1 to TableBox.GetRowCount-1&lt;BR /&gt; concatText = ""&lt;BR /&gt; for ColIter =0 to TableBox.GetColumnCount-2 'Don't include the last column (row)&lt;BR /&gt; set cell = TableBox.GetCell(RowIter,ColIter)&lt;BR /&gt; concatText = concatText + cell.Text + ";"&lt;BR /&gt; next&lt;BR /&gt; concatText = left(concatText, len(concatText)-1) ' Remove the trailing ;&lt;BR /&gt; msgbox(concatText)&lt;BR /&gt;next&lt;BR /&gt;end sub&lt;/P&gt;&lt;P&gt;Hope it's what you we're looking for.&lt;/P&gt;&lt;P&gt;/Fredrik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Dec 2009 23:40:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/looping-through-all-rows-in-a-transactiontable-with-a-macro/m-p/188448#M51693</guid>
      <dc:creator />
      <dc:date>2009-12-16T23:40:00Z</dc:date>
    </item>
    <item>
      <title>SV:Re: looping through all rows in a transactiontable with a macro</title>
      <link>https://community.qlik.com/t5/QlikView/looping-through-all-rows-in-a-transactiontable-with-a-macro/m-p/188449#M51694</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Elegant!&lt;/P&gt;&lt;P&gt;This script is perfect!&lt;/P&gt;&lt;P&gt;Thank You very much!&lt;/P&gt;&lt;P&gt;/Robert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Dec 2009 01:09:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/looping-through-all-rows-in-a-transactiontable-with-a-macro/m-p/188449#M51694</guid>
      <dc:creator />
      <dc:date>2009-12-17T01:09:11Z</dc:date>
    </item>
  </channel>
</rss>

