<?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: Combinations of numbers in 1 column in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Combinations-of-numbers-in-1-column/m-p/1650227#M48510</link>
    <description>&lt;P&gt;Thanks for a cool question, had a lot of fun automating it, solution below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table:&lt;BR /&gt;load * inline [&lt;BR /&gt;col1, col2, col3, col4,&lt;/P&gt;&lt;P&gt;1, 1, 7, 10&lt;/P&gt;&lt;P&gt;1, 2, 5, 15&lt;/P&gt;&lt;P&gt;1, 3, 6, 15&lt;/P&gt;&lt;P&gt;1, 4, 8, 10&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;LET vFieldNo = NoOfFields('Table');&lt;/P&gt;&lt;P&gt;set i = 1;&lt;BR /&gt;set k = 2;&lt;/P&gt;&lt;P&gt;do while i &amp;lt;= $(vFieldNo)&lt;BR /&gt;AllNumbers:&lt;BR /&gt;LOAD Distinct col$(i) as Numbers&lt;BR /&gt;Resident Table;&lt;BR /&gt;let i = $(i)+1;&lt;BR /&gt;loop&lt;/P&gt;&lt;P&gt;let i = 1;&lt;/P&gt;&lt;P&gt;do while k&amp;lt;= $(vFieldNo)&lt;/P&gt;&lt;P&gt;let j = $(vFieldNo)-$(k); //2 with 4col&lt;/P&gt;&lt;P&gt;do while j&amp;lt; $(vFieldNo)&lt;BR /&gt;if i = 1 then&lt;BR /&gt;Pairs$(k):&lt;BR /&gt;LOAD Numbers as [Numbers$(i)-$(k)]&lt;BR /&gt;Resident AllNumbers;&lt;BR /&gt;else&lt;BR /&gt;join (Pairs$(k))&lt;BR /&gt;LOAD Numbers as [Numbers$(i)-$(k)]&lt;BR /&gt;Resident AllNumbers;&lt;BR /&gt;end if&lt;BR /&gt;let j = $(j)+1;&lt;BR /&gt;let i = $(i)+1;&lt;BR /&gt;loop&lt;/P&gt;&lt;P&gt;let k = $(k)+1;&lt;BR /&gt;let i = 1;&lt;BR /&gt;loop&lt;/P&gt;&lt;P&gt;DROP Tables Table, AllNumbers;&lt;/P&gt;</description>
    <pubDate>Fri, 22 Nov 2019 16:18:14 GMT</pubDate>
    <dc:creator>y_grynechko</dc:creator>
    <dc:date>2019-11-22T16:18:14Z</dc:date>
    <item>
      <title>Combinations of numbers in 1 column</title>
      <link>https://community.qlik.com/t5/App-Development/Combinations-of-numbers-in-1-column/m-p/1649641#M48456</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;a complex question from me that may well have been answered somewhere before but thought i would ask in case it hasnt...&lt;/P&gt;&lt;P&gt;what i am trying to do is work out all number permutations of 4 columns of numbers (or a single column if all concatenated together).. this could end up as 10 number columns&lt;/P&gt;&lt;P&gt;i have 4 columns and want to work out all combinations of number permutations for example:&lt;/P&gt;&lt;P&gt;col1 .&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; col2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;col3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;col4&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;7&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 10&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 15&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 6&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;15&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 8&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2 number combos:&lt;/P&gt;&lt;P&gt;1,1 : 1,2: 1,3: 1,4 : 1,7 : 1,5 : 1,6 : 1,8 : 2,5 : 3,6 : 4,8: 1,10 : 7,10 : 4,10 : 8,10 : 1,15 : 2,15 : 5,15 : 3,15 : so on and so on...&lt;/P&gt;&lt;P&gt;then 3 number combos:&lt;/P&gt;&lt;P&gt;1,1,7 : 1,7,10 : 1,2,5 : 2,5,15 : 1,5,15 : 3,6,15 : 1,6,15 : so on and so on&lt;/P&gt;&lt;P&gt;then 4 number combos (in this case the unique 4 columns:&lt;/P&gt;&lt;P&gt;1,1,7,10 : 1,2,5,15 : 1,3,6,15 : 1,4,8,10 : so on and so on...&amp;nbsp;&lt;/P&gt;&lt;P&gt;then if i had 5 digit columns this would then go 5,6,7 number combos and so on...&amp;nbsp;&lt;/P&gt;&lt;P&gt;i ideally then wanna take all permutations of 2digit numbers and&amp;nbsp; create a 2 number combo table, a 3 number combo table, a 4 number combo table that all link based on some random generated key that combines all together&lt;/P&gt;&lt;P&gt;this may not be explained very well but basically wanting to work out any combinations of these numbers&lt;/P&gt;</description>
      <pubDate>Wed, 22 Dec 2021 17:20:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Combinations-of-numbers-in-1-column/m-p/1649641#M48456</guid>
      <dc:creator>LeeSmithBtn</dc:creator>
      <dc:date>2021-12-22T17:20:13Z</dc:date>
    </item>
    <item>
      <title>Re: Combinations of numbers in 1 column</title>
      <link>https://community.qlik.com/t5/App-Development/Combinations-of-numbers-in-1-column/m-p/1649811#M48469</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;do you want to have only a pairs of Col1,Col2 or&amp;nbsp;Col1,Col2 and Col2,Col1?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2019 20:19:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Combinations-of-numbers-in-1-column/m-p/1649811#M48469</guid>
      <dc:creator>y_grynechko</dc:creator>
      <dc:date>2019-11-21T20:19:04Z</dc:date>
    </item>
    <item>
      <title>Re: Combinations of numbers in 1 column</title>
      <link>https://community.qlik.com/t5/App-Development/Combinations-of-numbers-in-1-column/m-p/1649817#M48470</link>
      <description>&lt;P&gt;try this method:&lt;/P&gt;&lt;P&gt;load your data in, lets assume there is a key and 4 number columns (key,c1, c2, c3, c4).&lt;/P&gt;&lt;P&gt;make a straight table for each set combinations with the following DIMENSION columns:&lt;/P&gt;&lt;P&gt;c1&amp;amp;'|'c2&lt;BR /&gt;rowno(total) - this will give you the number of permutations)&lt;/P&gt;&lt;P&gt;next table:&lt;BR /&gt;c1&amp;amp;'|'&amp;amp;c2&amp;amp;'|'&amp;amp;c3&lt;BR /&gt;rowno(total)&lt;/P&gt;&lt;P&gt;repeat until you have figured out all of your combinations.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2019 20:45:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Combinations-of-numbers-in-1-column/m-p/1649817#M48470</guid>
      <dc:creator>jheasley</dc:creator>
      <dc:date>2019-11-21T20:45:44Z</dc:date>
    </item>
    <item>
      <title>Re: Combinations of numbers in 1 column</title>
      <link>https://community.qlik.com/t5/App-Development/Combinations-of-numbers-in-1-column/m-p/1649910#M48477</link>
      <description>&lt;P&gt;hey,&lt;/P&gt;&lt;P&gt;try to use composite key&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Nov 2019 06:54:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Combinations-of-numbers-in-1-column/m-p/1649910#M48477</guid>
      <dc:creator>Gopi_E</dc:creator>
      <dc:date>2019-11-22T06:54:49Z</dc:date>
    </item>
    <item>
      <title>Re: Combinations of numbers in 1 column</title>
      <link>https://community.qlik.com/t5/App-Development/Combinations-of-numbers-in-1-column/m-p/1650227#M48510</link>
      <description>&lt;P&gt;Thanks for a cool question, had a lot of fun automating it, solution below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table:&lt;BR /&gt;load * inline [&lt;BR /&gt;col1, col2, col3, col4,&lt;/P&gt;&lt;P&gt;1, 1, 7, 10&lt;/P&gt;&lt;P&gt;1, 2, 5, 15&lt;/P&gt;&lt;P&gt;1, 3, 6, 15&lt;/P&gt;&lt;P&gt;1, 4, 8, 10&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;LET vFieldNo = NoOfFields('Table');&lt;/P&gt;&lt;P&gt;set i = 1;&lt;BR /&gt;set k = 2;&lt;/P&gt;&lt;P&gt;do while i &amp;lt;= $(vFieldNo)&lt;BR /&gt;AllNumbers:&lt;BR /&gt;LOAD Distinct col$(i) as Numbers&lt;BR /&gt;Resident Table;&lt;BR /&gt;let i = $(i)+1;&lt;BR /&gt;loop&lt;/P&gt;&lt;P&gt;let i = 1;&lt;/P&gt;&lt;P&gt;do while k&amp;lt;= $(vFieldNo)&lt;/P&gt;&lt;P&gt;let j = $(vFieldNo)-$(k); //2 with 4col&lt;/P&gt;&lt;P&gt;do while j&amp;lt; $(vFieldNo)&lt;BR /&gt;if i = 1 then&lt;BR /&gt;Pairs$(k):&lt;BR /&gt;LOAD Numbers as [Numbers$(i)-$(k)]&lt;BR /&gt;Resident AllNumbers;&lt;BR /&gt;else&lt;BR /&gt;join (Pairs$(k))&lt;BR /&gt;LOAD Numbers as [Numbers$(i)-$(k)]&lt;BR /&gt;Resident AllNumbers;&lt;BR /&gt;end if&lt;BR /&gt;let j = $(j)+1;&lt;BR /&gt;let i = $(i)+1;&lt;BR /&gt;loop&lt;/P&gt;&lt;P&gt;let k = $(k)+1;&lt;BR /&gt;let i = 1;&lt;BR /&gt;loop&lt;/P&gt;&lt;P&gt;DROP Tables Table, AllNumbers;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Nov 2019 16:18:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Combinations-of-numbers-in-1-column/m-p/1650227#M48510</guid>
      <dc:creator>y_grynechko</dc:creator>
      <dc:date>2019-11-22T16:18:14Z</dc:date>
    </item>
  </channel>
</rss>

