<?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: How to pass values to lookup table in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-to-pass-values-to-lookup-table/m-p/2222067#M15812</link>
    <description>on each iteration after file list you can get global variables globalMap.get("tFileList_1_xxx").&lt;BR /&gt;&lt;BR /&gt;if you generate file name into a ^ql table you may use tFlowToIterate who help you to define variables.&lt;BR /&gt;</description>
    <pubDate>Mon, 02 Sep 2019 09:06:01 GMT</pubDate>
    <dc:creator>fdenis</dc:creator>
    <dc:date>2019-09-02T09:06:01Z</dc:date>
    <item>
      <title>How to pass values to lookup table</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-pass-values-to-lookup-table/m-p/2222064#M15809</link>
      <description>&lt;P&gt;I have a set of files to load say 3 files. I first load the STG0 load control table in which I generate&amp;nbsp; batch id and file id and derive the file name (((String)globalMap.get("tFileList_1_CURRENT_FILE")) ).&amp;nbsp;So When I load 3 files in one batch and 2 files in the next batch, the target will look like&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;BATCh ID&lt;/TD&gt;&lt;TD&gt;FILE ID&lt;/TD&gt;&lt;TD&gt;FILE NAME&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;FILE1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;FILE2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;FILE3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;FILE4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;FILE5&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Next I have to load the STG1 table with the data coming from the file along with the batch id and file id generated in the STG0 table. I created a tDBInput pointing to STG0 table as the look up as shown in attached screenshot. But I am not sure how to create a variable to store file name and pass it on to the look up to get batch id and file id. I am new to talend. Any help would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 04:49:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-pass-values-to-lookup-table/m-p/2222064#M15809</guid>
      <dc:creator>A_San</dc:creator>
      <dc:date>2024-11-16T04:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass values to lookup table</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-pass-values-to-lookup-table/m-p/2222065#M15810</link>
      <description>you can use global variables of step 1 into your step 2.&lt;BR /&gt;but I did not see where did you set file Id.&lt;BR /&gt;on my point of view Batch id have to be set as context and it must be defined by the caller job.&lt;BR /&gt;file ID is ((Integer)globalMap.get("tFileList_1_NB_FILE"))&lt;BR /&gt;good luck</description>
      <pubDate>Fri, 30 Aug 2019 08:50:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-pass-values-to-lookup-table/m-p/2222065#M15810</guid>
      <dc:creator>fdenis</dc:creator>
      <dc:date>2019-08-30T08:50:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass values to lookup table</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-pass-values-to-lookup-table/m-p/2222066#M15811</link>
      <description>&lt;P&gt;Batch id and file id are generated in another job say Job1 that loads the STG0 table. Now I am getting Job2 ready to load STG1 table.&lt;/P&gt;
&lt;P&gt;I have attached the screenshot of my job1 for reference.&lt;/P&gt;
&lt;P&gt;Could you please let me know where exactly I should declare the global variable?&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/legacyfs/online/tlnd_dw_files/0683p000009LwRj"&gt;SS12.PNG&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/legacyfs/online/tlnd_dw_files/0683p000009LwRo"&gt;SS11.PNG&lt;/A&gt;</description>
      <pubDate>Fri, 30 Aug 2019 16:17:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-pass-values-to-lookup-table/m-p/2222066#M15811</guid>
      <dc:creator>A_San</dc:creator>
      <dc:date>2019-08-30T16:17:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass values to lookup table</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-pass-values-to-lookup-table/m-p/2222067#M15812</link>
      <description>on each iteration after file list you can get global variables globalMap.get("tFileList_1_xxx").&lt;BR /&gt;&lt;BR /&gt;if you generate file name into a ^ql table you may use tFlowToIterate who help you to define variables.&lt;BR /&gt;</description>
      <pubDate>Mon, 02 Sep 2019 09:06:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-pass-values-to-lookup-table/m-p/2222067#M15812</guid>
      <dc:creator>fdenis</dc:creator>
      <dc:date>2019-09-02T09:06:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass values to lookup table</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-pass-values-to-lookup-table/m-p/2222068#M15813</link>
      <description>&lt;P&gt;I already have the file name in the STG0 table in job1. I just need the batch id and file id from the STG0 table for the respective files and load in STG1 table in job2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When you mentioned this "&lt;SPAN&gt;on each iteration after file list you can get global variables globalMap.get("tFileList_1_xxx").", do you mean to have tSetGlobalVar after tFileList?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2019 18:44:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-pass-values-to-lookup-table/m-p/2222068#M15813</guid>
      <dc:creator>A_San</dc:creator>
      <dc:date>2019-09-03T18:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass values to lookup table</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-pass-values-to-lookup-table/m-p/2222069#M15814</link>
      <description>global variables are define into tFileList you can use them into all component who are behint tFileListe.&lt;BR /&gt;You do not have to re-ret global variables.&lt;BR /&gt;if you have file name into your db you did not need filelist you just have to get row from a db, use tflow to iterate to defin global varriables then use global variable to read file.&lt;BR /&gt;you can define batch and file ids ito your db.</description>
      <pubDate>Wed, 04 Sep 2019 08:51:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-pass-values-to-lookup-table/m-p/2222069#M15814</guid>
      <dc:creator>fdenis</dc:creator>
      <dc:date>2019-09-04T08:51:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass values to lookup table</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-pass-values-to-lookup-table/m-p/2222070#M15815</link>
      <description>&lt;P&gt;I am not sure I understand. I am new to Talend. I want to use the file names in the job2 to look up on the table STG0 to get batch id and file id.&lt;/P&gt;
&lt;P&gt;If there is a&amp;nbsp; look up query then it would be like&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Select batch_id,file_id from STG0 where STG0.filename = &amp;lt;filename from job2&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have attached a screenshot of the job2. I am getting the following error.&lt;/P&gt;
&lt;P&gt;Error in the component's properties:The left-hand side of an assignment must be a variable&lt;BR /&gt;Syntax error on token "tFileList_1_CURRENT_FILE", invalid AssignmentOperator&lt;/P&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/legacyfs/online/tlnd_dw_files/0683p000009LwLs"&gt;SS13.PNG&lt;/A&gt;</description>
      <pubDate>Wed, 04 Sep 2019 21:43:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-pass-values-to-lookup-table/m-p/2222070#M15815</guid>
      <dc:creator>A_San</dc:creator>
      <dc:date>2019-09-04T21:43:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass values to lookup table</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-pass-values-to-lookup-table/m-p/2222071#M15816</link>
      <description>&lt;P&gt;Can you please try the following in your lookup query:&lt;/P&gt;&lt;PRE&gt;"select Id_batch, Id_fil_id, name from stg_0_Id_cntl_nmc where Id_fil_name = '" + ((String)globalMap.get("tFileList_1_CURRENT_FILE")) + "'"&lt;/PRE&gt;</description>
      <pubDate>Thu, 05 Sep 2019 15:57:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-pass-values-to-lookup-table/m-p/2222071#M15816</guid>
      <dc:creator>JR1</dc:creator>
      <dc:date>2019-09-05T15:57:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass values to lookup table</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-pass-values-to-lookup-table/m-p/2222072#M15817</link>
      <description>&lt;P&gt;Thank you JR. The query worked without errors but it did not return any rows. Please see my attached screenshots (job, stg0 table and tmap mapping).&lt;/P&gt;
&lt;P&gt;Could it be because the tDBInput is not connected to the tFIleInputDelimited directly?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/legacyfs/online/tlnd_dw_files/0683p000009LwNs"&gt;SS14.PNG&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/legacyfs/online/tlnd_dw_files/0683p000009Lw7c"&gt;tmap.PNG&lt;/A&gt;</description>
      <pubDate>Thu, 05 Sep 2019 16:26:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-pass-values-to-lookup-table/m-p/2222072#M15817</guid>
      <dc:creator>A_San</dc:creator>
      <dc:date>2019-09-05T16:26:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass values to lookup table</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-pass-values-to-lookup-table/m-p/2222073#M15818</link>
      <description>&lt;P&gt;Try the following for your lookup query&lt;/P&gt;&lt;PRE&gt;"select Id_batch, Id_fil_id, Id_fil_name from stg_0_Id_cntl_nmc where Id_fil_name = '" + ((String)globalMap.get("tFileList_1_CURRENT_FILE")) + "'"&lt;/PRE&gt;&lt;P&gt;Then add the column Id_fil_name to your tDBInput schema. In the tMap put&amp;nbsp;((String)globalMap.get("tFileList_1_CURRENT_FILE")) as the "Expr. key" of column "Id_fil_name" in row2.&lt;/P&gt;&lt;P&gt;Let us know how this works out.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2019 16:52:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-pass-values-to-lookup-table/m-p/2222073#M15818</guid>
      <dc:creator>JR1</dc:creator>
      <dc:date>2019-09-05T16:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass values to lookup table</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-pass-values-to-lookup-table/m-p/2222074#M15819</link>
      <description>&lt;P&gt;Still no luck. 0 records are returned from the look up. Attached screenshots.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/legacyfs/online/tlnd_dw_files/0683p000009LwTf"&gt;tmap.PNG&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/legacyfs/online/tlnd_dw_files/0683p000009LwLc"&gt;SS15.PNG&lt;/A&gt;</description>
      <pubDate>Thu, 05 Sep 2019 18:41:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-pass-values-to-lookup-table/m-p/2222074#M15819</guid>
      <dc:creator>A_San</dc:creator>
      <dc:date>2019-09-05T18:41:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass values to lookup table</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-pass-values-to-lookup-table/m-p/2222075#M15820</link>
      <description>&lt;P&gt;JR,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried giving the query as "select LD_FIL_NAME,LD_BATCH_ID, LD_FIL_ID from stg_0_ld_cntl_nmc ". I removed the where condition.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I retained the LD_FIL_NAME in the tmap as you had suggested. Now I see 3 records were returned from the look up and the STG1 table got populated properly.&lt;/P&gt;
&lt;P&gt;Thank you so much for your help.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2019 19:20:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-pass-values-to-lookup-table/m-p/2222075#M15820</guid>
      <dc:creator>A_San</dc:creator>
      <dc:date>2019-09-05T19:20:21Z</dc:date>
    </item>
  </channel>
</rss>

