<?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: Add a column with nested source_lookup in Qlik Replicate</title>
    <link>https://community.qlik.com/t5/Qlik-Replicate/Add-a-column-with-nested-source-lookup/m-p/1876309#M1513</link>
    <description>&lt;P&gt;I see.&amp;nbsp; Good to know, totally makes sense.&lt;/P&gt;
&lt;P&gt;A follow up question...&lt;/P&gt;
&lt;P&gt;Can Replicate call a sp or function?&lt;/P&gt;</description>
    <pubDate>Fri, 31 Dec 2021 11:02:08 GMT</pubDate>
    <dc:creator>RonFusionHSLLC</dc:creator>
    <dc:date>2021-12-31T11:02:08Z</dc:date>
    <item>
      <title>Add a column with nested source_lookup</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Add-a-column-with-nested-source-lookup/m-p/1876243#M1509</link>
      <description>&lt;P&gt;In Replication, I need to synthesize a column from a nested source_lookup function...doesnt seem to work; or did I do it wrong...?&lt;/P&gt;
&lt;P&gt;Trying to add a column to a table called AccountDetails, and fill it from a lookup function.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The table has a column called AccountID (fk to Account.ID)&lt;/P&gt;
&lt;P&gt;The table Account, has a column called OrgID (fk to Orgs.ID)&lt;/P&gt;
&lt;P&gt;The table Orgs has a value AccountNumPfx, I want populate the value of a new column with AccountNumPfx&lt;/P&gt;
&lt;P&gt;Something like this...&lt;/P&gt;
&lt;P&gt;The inner source_lookup picks up the ID field from Orgs.ID using $AccountID from the current table, passes that back to the outer source_lookup, which returns the AccountNumPf&lt;/P&gt;
&lt;P&gt;source_lookup(10000,'dbo','Orgs','[AccountNumPfx]','[ID]=?',source_lookup(10000,'dbo','Account','[OrgID]','[ID]=?',$AccountID))&lt;/P&gt;
&lt;P&gt;Ron&lt;/P&gt;</description>
      <pubDate>Thu, 30 Dec 2021 22:50:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Add-a-column-with-nested-source-lookup/m-p/1876243#M1509</guid>
      <dc:creator>RonFusionHSLLC</dc:creator>
      <dc:date>2021-12-30T22:50:59Z</dc:date>
    </item>
    <item>
      <title>Re: Add a column with nested source_lookup</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Add-a-column-with-nested-source-lookup/m-p/1876272#M1512</link>
      <description>&lt;P&gt;No can do. No nesting. And you really don't want to do this anyway if performance is of any concern. You Don't want to send a singleton select&amp;nbsp; to the source DB twice when conceptionally one singleton joined lookup will do.&lt;/P&gt;
&lt;P&gt;Documentation (12 Customizing tasks, Data Enrichment input parameters)&amp;nbsp; states&amp;nbsp; for&amp;nbsp; 'EXP' : "Note: The expression syntax must be native to the endpoint it accesses.". Well, source_lookup is native to Replicate, not to the DB.&lt;/P&gt;
&lt;P&gt;Your best, cleanest, bet is a VIEW on the source to join Orgs and Account&lt;/P&gt;
&lt;P&gt;*untested* You might try to create the join in table/expression arguments by specifying 'Orgs, Account' for TBL and&amp;nbsp; something like&amp;nbsp; 'Orgs.ID = Account.OrigID AND Account.ID = ?' for EXP.&lt;/P&gt;
&lt;P&gt;hth,&lt;/P&gt;
&lt;P&gt;Hein&lt;/P&gt;</description>
      <pubDate>Fri, 31 Dec 2021 04:43:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Add-a-column-with-nested-source-lookup/m-p/1876272#M1512</guid>
      <dc:creator>Heinvandenheuvel</dc:creator>
      <dc:date>2021-12-31T04:43:10Z</dc:date>
    </item>
    <item>
      <title>Re: Add a column with nested source_lookup</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Add-a-column-with-nested-source-lookup/m-p/1876309#M1513</link>
      <description>&lt;P&gt;I see.&amp;nbsp; Good to know, totally makes sense.&lt;/P&gt;
&lt;P&gt;A follow up question...&lt;/P&gt;
&lt;P&gt;Can Replicate call a sp or function?&lt;/P&gt;</description>
      <pubDate>Fri, 31 Dec 2021 11:02:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Add-a-column-with-nested-source-lookup/m-p/1876309#M1513</guid>
      <dc:creator>RonFusionHSLLC</dc:creator>
      <dc:date>2021-12-31T11:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: Add a column with nested source_lookup</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Add-a-column-with-nested-source-lookup/m-p/1876352#M1515</link>
      <description>&lt;P&gt;&amp;gt;&amp;gt;&amp;nbsp;&lt;SPAN&gt;Good to know, totally makes sense.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;The query arguments in the source_lookup statement are used to create a SQl statement using simple text replacement. Like a sprintf.&lt;/P&gt;
&lt;P&gt;Replicate simply creates&amp;nbsp; "&lt;FONT color="#FF0000"&gt;SELECT&lt;/FONT&gt; EXP &lt;FONT color="#FF0000"&gt;FROM&lt;/FONT&gt; CHM.TBL &lt;FONT color="#FF0000"&gt;WHERE&lt;/FONT&gt; COND&lt;FONT color="#FF0000"&gt;;&lt;/FONT&gt;"&lt;/P&gt;
&lt;P&gt;You can verify that with with verbose logging (just use a 1 table, 1 row test case) as well as in the database SQL cache.&lt;/P&gt;
&lt;P&gt;&amp;gt;&amp;gt;&lt;SPAN&gt;Can Replicate call a sp or function?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Yes - it indicates EXP for Expression.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Hein.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Dec 2021 15:29:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Add-a-column-with-nested-source-lookup/m-p/1876352#M1515</guid>
      <dc:creator>Heinvandenheuvel</dc:creator>
      <dc:date>2021-12-31T15:29:41Z</dc:date>
    </item>
    <item>
      <title>Re: Add a column with nested source_lookup</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Add-a-column-with-nested-source-lookup/m-p/1876358#M1516</link>
      <description>&lt;P&gt;Nice...thanks for the tip&lt;/P&gt;</description>
      <pubDate>Fri, 31 Dec 2021 16:19:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Add-a-column-with-nested-source-lookup/m-p/1876358#M1516</guid>
      <dc:creator>RonFusionHSLLC</dc:creator>
      <dc:date>2021-12-31T16:19:06Z</dc:date>
    </item>
  </channel>
</rss>

