<?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: Loop through subfields in Script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Loop-through-subfields-in-Script/m-p/421261#M1160347</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm afraid you'll have to write out the subfield expressions for the months. Luckily there's only twelve and coopy/paste helps too. Try: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table1:&lt;/P&gt;&lt;P&gt;Crosstable(Month,Amount,2)&lt;/P&gt;&lt;P&gt;load &lt;/P&gt;&lt;P&gt;Entity, Year,&lt;/P&gt;&lt;P&gt;subfield(Amount,';',1) as Jan,&lt;/P&gt;&lt;P&gt;subfield(Amount,';',2) as Feb,&lt;/P&gt;&lt;P&gt;...etc&lt;/P&gt;&lt;P&gt;subfield(Amount,';',12) as Dec&lt;/P&gt;&lt;P&gt;from ...etc ;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 10 Dec 2012 14:11:36 GMT</pubDate>
    <dc:creator>Gysbert_Wassenaar</dc:creator>
    <dc:date>2012-12-10T14:11:36Z</dc:date>
    <item>
      <title>Loop through subfields in Script</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-through-subfields-in-Script/m-p/421260#M1160346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created an ODBC link to one of our tables from our accounting system.&lt;/P&gt;&lt;P&gt;I have 3 fields in this table:&lt;/P&gt;&lt;P&gt;-year &lt;/P&gt;&lt;P&gt;-entity&lt;/P&gt;&lt;P&gt;-amount (this field consists of 12 subfields for each month. The months are separated by '; ' ). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do i update this table so it has 4 fields&lt;/P&gt;&lt;P&gt;- year&lt;/P&gt;&lt;P&gt;- entity&lt;/P&gt;&lt;P&gt;- month&lt;/P&gt;&lt;P&gt;- amount&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know how to separate the amount - subfield(amount, ";" ), but i don't know how to create a new field for month.&amp;nbsp; That is, the first subfield will have a month of January, the second subfield will have a month of February etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your help will be greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Dec 2012 12:36:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-through-subfields-in-Script/m-p/421260#M1160346</guid>
      <dc:creator />
      <dc:date>2012-12-10T12:36:49Z</dc:date>
    </item>
    <item>
      <title>Re: Loop through subfields in Script</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-through-subfields-in-Script/m-p/421261#M1160347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm afraid you'll have to write out the subfield expressions for the months. Luckily there's only twelve and coopy/paste helps too. Try: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table1:&lt;/P&gt;&lt;P&gt;Crosstable(Month,Amount,2)&lt;/P&gt;&lt;P&gt;load &lt;/P&gt;&lt;P&gt;Entity, Year,&lt;/P&gt;&lt;P&gt;subfield(Amount,';',1) as Jan,&lt;/P&gt;&lt;P&gt;subfield(Amount,';',2) as Feb,&lt;/P&gt;&lt;P&gt;...etc&lt;/P&gt;&lt;P&gt;subfield(Amount,';',12) as Dec&lt;/P&gt;&lt;P&gt;from ...etc ;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Dec 2012 14:11:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-through-subfields-in-Script/m-p/421261#M1160347</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2012-12-10T14:11:36Z</dc:date>
    </item>
    <item>
      <title>Re: Loop through subfields in Script</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-through-subfields-in-Script/m-p/421262#M1160348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Gysbert.&amp;nbsp; I had not considered the Crosstable function .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Dec 2012 22:30:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-through-subfields-in-Script/m-p/421262#M1160348</guid>
      <dc:creator />
      <dc:date>2012-12-13T22:30:18Z</dc:date>
    </item>
    <item>
      <title>Re: Loop through subfields in Script</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-through-subfields-in-Script/m-p/421263#M1160349</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can also go with this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Entity, Year,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Pick(iterno(), 'Jan','Feb', 'Mar', 'Apr', 'May',.......'Dec') AS Month// or Iterno AS MonthNo&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SubField(Amount, iterno()) AS Amount&lt;/P&gt;&lt;P&gt;Resident TableName&lt;/P&gt;&lt;P&gt;While iterno()&amp;lt;=12;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To use as MonthNo you need to load inline table like below&lt;/P&gt;&lt;P&gt;Load * Inline {&lt;/P&gt;&lt;P&gt;MonthNo, Month&lt;/P&gt;&lt;P&gt;1, Jan&lt;/P&gt;&lt;P&gt;2,Feb&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;12, Dec];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Dec 2012 22:38:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-through-subfields-in-Script/m-p/421263#M1160349</guid>
      <dc:creator>CELAMBARASAN</dc:creator>
      <dc:date>2012-12-13T22:38:33Z</dc:date>
    </item>
  </channel>
</rss>

