<?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 Setting up context variable for tForEach Component in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Setting-up-context-variable-for-tForEach-Component/m-p/2248527#M33358</link>
    <description>I have a tForEach component as a part of my talend project, which iterates a particular transformation for different states of a country. I want to set up the list of these states as a context variable so that each time I want to use a set of different combinations of the number of states. Is this possible? 
&lt;BR /&gt;Ex: I have 10 states in the tForEach component. For testing purpose, I want to use only 3 states to be processed. If it is not a context variable, everytime the list of states in the component needs to be updated on the job and re exported. I do not want to do that each time. Rather, I would like to set the list as a part of contexts and update the list according to requirement.</description>
    <pubDate>Mon, 11 Jun 2012 14:16:02 GMT</pubDate>
    <dc:creator>_AnonymousUser</dc:creator>
    <dc:date>2012-06-11T14:16:02Z</dc:date>
    <item>
      <title>Setting up context variable for tForEach Component</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Setting-up-context-variable-for-tForEach-Component/m-p/2248527#M33358</link>
      <description>I have a tForEach component as a part of my talend project, which iterates a particular transformation for different states of a country. I want to set up the list of these states as a context variable so that each time I want to use a set of different combinations of the number of states. Is this possible? 
&lt;BR /&gt;Ex: I have 10 states in the tForEach component. For testing purpose, I want to use only 3 states to be processed. If it is not a context variable, everytime the list of states in the component needs to be updated on the job and re exported. I do not want to do that each time. Rather, I would like to set the list as a part of contexts and update the list according to requirement.</description>
      <pubDate>Mon, 11 Jun 2012 14:16:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Setting-up-context-variable-for-tForEach-Component/m-p/2248527#M33358</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2012-06-11T14:16:02Z</dc:date>
    </item>
    <item>
      <title>Re: Setting up context variable for tForEach Component</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Setting-up-context-variable-for-tForEach-Component/m-p/2248528#M33359</link>
      <description>Hi&lt;BR /&gt;The code of tForEach is as seen below.&lt;BR /&gt;&lt;PRE&gt;Object[] values_tForeach_1 = new Object[] { "newLine", };&lt;BR /&gt;for (Object tmp_tForeach_1 : values_tForeach_1)&lt;/PRE&gt;&lt;BR /&gt;I don't think you can use a context variable here which contains 10 or 3 states name.&lt;BR /&gt;Regards,&lt;BR /&gt;Pedro</description>
      <pubDate>Tue, 12 Jun 2012 06:54:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Setting-up-context-variable-for-tForEach-Component/m-p/2248528#M33359</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-06-12T06:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: Setting up context variable for tForEach Component</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Setting-up-context-variable-for-tForEach-Component/m-p/2248529#M33360</link>
      <description>Hi 
&lt;BR /&gt;Maybe you don't need tForEach component, you can set the value of context variable with more states delimited by a syntax, for example, "state1,state2,state3,state4", and then use a tNormalize component to normalize the column to more columns with item separator "," for example, 
&lt;BR /&gt;state1,state2,state3,state4 
&lt;BR /&gt;becomes 
&lt;BR /&gt;state1 
&lt;BR /&gt;state2 
&lt;BR /&gt;state3 
&lt;BR /&gt;state4 
&lt;BR /&gt;and then, iterate each row. The job design looks like: 
&lt;BR /&gt;tFixedFlowInput--main--tNormalize--main--tFlowToIterate--iterate--the rest of the job. 
&lt;BR /&gt;on tFixedFlowInput, add one column let's call it "states", set its value with context variable. 
&lt;BR /&gt;Best regards 
&lt;BR /&gt;Shong</description>
      <pubDate>Tue, 12 Jun 2012 06:58:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Setting-up-context-variable-for-tForEach-Component/m-p/2248529#M33360</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-06-12T06:58:23Z</dc:date>
    </item>
    <item>
      <title>Re: Setting up context variable for tForEach Component</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Setting-up-context-variable-for-tForEach-Component/m-p/2248530#M33361</link>
      <description>Thanks Pedro and Shong.
&lt;BR /&gt;@ Shong:
&lt;BR /&gt;I will try doing as said. So, all I need to do here is not to disturb any other existing component, but set up a context variable for how many ever states I want to use and replace tForEach with a tNormalize component and set up the column name to be normalized with item separator ",". Is that right? 
&lt;BR /&gt;One quick clarification: Does this column name that we use in "Column to normalize" has to do with any particular field of a database table or how and where do we initialize/declare and map that column name to?
&lt;BR /&gt;Thanks</description>
      <pubDate>Tue, 12 Jun 2012 09:19:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Setting-up-context-variable-for-tForEach-Component/m-p/2248530#M33361</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2012-06-12T09:19:16Z</dc:date>
    </item>
  </channel>
</rss>

