<?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: Iterate through columns in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Iterate-through-columns/m-p/1756694#M64158</link>
    <description>&lt;P&gt;LOAD&lt;BR /&gt;Name1&amp;amp;F2 as Name1,&lt;BR /&gt;Name2&amp;amp;F4 as Name2&lt;/P&gt;&lt;P&gt;etc...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 28 Oct 2020 14:39:42 GMT</pubDate>
    <dc:creator>tm_burgers</dc:creator>
    <dc:date>2020-10-28T14:39:42Z</dc:date>
    <item>
      <title>Iterate through columns</title>
      <link>https://community.qlik.com/t5/App-Development/Iterate-through-columns/m-p/1753704#M64155</link>
      <description>&lt;P&gt;Hey!&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following poblem. My table looks like this:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Name1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Name2&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Value1A&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Value2A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Value1B&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Value2B&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I want my table to look like this:&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Name1&lt;/TD&gt;&lt;TD&gt;Name2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Value1A&lt;/TD&gt;&lt;TD&gt;Value2A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Value1B&lt;/TD&gt;&lt;TD&gt;Value2B&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Obviously, I could manually change the names of the columns in the script with the "as" command. Instead, I am looking for an algorithm that transforms my table automatically.&amp;nbsp;&lt;/P&gt;&lt;P&gt;As far as I know and researched, there aren't many Qlik functions for working with columns. Therefore i tried to accomplish something by working with variables, but the outcome was rather poor. My thoughts were:&lt;/P&gt;&lt;P&gt;1. Iterate through every column and give predefined variables a value (for example 0 if the column has only one non-zero value and 1 if the column has more than one value)&lt;/P&gt;&lt;P&gt;2. Take the first column whose variable has the value 0. Scan this column for its only non-zero value (for example Name1) and save it in another variable.&lt;/P&gt;&lt;P&gt;3. Take the first column whose variable has the value 1. Name this column with the variable from step 2&lt;/P&gt;&lt;P&gt;4. Do all this until there are no columns left&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe you (the community) could help me out here!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;Cem&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 01:16:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Iterate-through-columns/m-p/1753704#M64155</guid>
      <dc:creator>CemK</dc:creator>
      <dc:date>2024-11-16T01:16:37Z</dc:date>
    </item>
    <item>
      <title>Re: Iterate through columns</title>
      <link>https://community.qlik.com/t5/App-Development/Iterate-through-columns/m-p/1753735#M64156</link>
      <description>&lt;P&gt;when you say your table looks like this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;I have the following poblem. My table looks like this:&lt;/EM&gt;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Name1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Name2&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Value1A&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Value2A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Value1B&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Value2B&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is it an input file?&amp;nbsp; couldnt be a qlikview table as a QV table will always have a field name.&amp;nbsp; is it from EXCEL?&amp;nbsp; what is your source?&amp;nbsp; will the data always be one column to the right of the field name?&amp;nbsp; will there only always be just 2 columns or are the number of columns changing with the input file?&lt;/P&gt;&lt;P&gt;pls provide more info&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2020 12:40:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Iterate-through-columns/m-p/1753735#M64156</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2020-10-19T12:40:14Z</dc:date>
    </item>
    <item>
      <title>Re: Iterate through columns</title>
      <link>https://community.qlik.com/t5/App-Development/Iterate-through-columns/m-p/1753748#M64157</link>
      <description>&lt;P&gt;Hey Edwin, thanks for the reply!&lt;/P&gt;&lt;P&gt;The source is a csv file and the data will always be to the right of the field name. The number of columns in total is 34 and the number will not change.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2020 13:02:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Iterate-through-columns/m-p/1753748#M64157</guid>
      <dc:creator>CemK</dc:creator>
      <dc:date>2020-10-19T13:02:42Z</dc:date>
    </item>
    <item>
      <title>Re: Iterate through columns</title>
      <link>https://community.qlik.com/t5/App-Development/Iterate-through-columns/m-p/1756694#M64158</link>
      <description>&lt;P&gt;LOAD&lt;BR /&gt;Name1&amp;amp;F2 as Name1,&lt;BR /&gt;Name2&amp;amp;F4 as Name2&lt;/P&gt;&lt;P&gt;etc...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2020 14:39:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Iterate-through-columns/m-p/1756694#M64158</guid>
      <dc:creator>tm_burgers</dc:creator>
      <dc:date>2020-10-28T14:39:42Z</dc:date>
    </item>
  </channel>
</rss>

