<?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>Question Re: bods: how to implement subquery in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/bods-how-to-implement-subquery/qaa-p/490756#M88280</link>
    <description>&lt;P&gt;Hi &lt;A href="https://answers.sap.com/users/6628/swethan5.html"&gt;Swetha N&lt;/A&gt;,&lt;/P&gt;
  &lt;P&gt; say you have a subquery like&lt;/P&gt;
  &lt;P&gt; select id,name from TABLE_A where id in (select id from TABLE_B);&lt;/P&gt;
  &lt;P&gt; step 1:- Take TABLE_A and TABLE_B as sources in a dataflow, &lt;/P&gt;
  &lt;P&gt;step 2:- Take a Query transform after TABLE_B and map only ID column in the schema_out.&lt;/P&gt;
  &lt;P&gt; step 3:- Take a Query transform after TABLE_A and map ID, NALE in the schema out.&lt;/P&gt;
  &lt;P&gt;step 4:- join Query of TABLE_A and Query of TABLE_B on column TABLE_A.ID=TABLE_A.ID.&lt;/P&gt;
  &lt;P&gt; in case of self join, take the table 2 times as sources in Dataflow and join.&lt;/P&gt;
  &lt;P&gt; Split that complicated query into several dataflows in BODS for better performance, dont try to do in a single dataflow. &lt;/P&gt;
  &lt;P&gt; If data is huge and you want to pushdown the query to database, then perform step 2 above in a dataflow and stage data in a table, and step 3 in a dataflow and stage data in a table and step 4 in a dataflow where you can join the the tables of step 2 and step 3 and full pushdown is possible. &lt;/P&gt;
  &lt;P&gt; Thanks,&lt;/P&gt;
  &lt;P&gt; Ravi kiran.&lt;/P&gt;</description>
    <pubDate>Thu, 05 Oct 2017 15:22:35 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2017-10-05T15:22:35Z</dc:date>
    <item>
      <title>bods: how to implement subquery</title>
      <link>https://community.sap.com/t5/technology-q-a/bods-how-to-implement-subquery/qaq-p/490755</link>
      <description>&lt;P&gt;hi all,&lt;/P&gt;
  &lt;P&gt;i am having very complicated query to be implemented in bods.&lt;/P&gt;
  &lt;P&gt;usage of sql transform is strictly prohibited in teh project.&lt;/P&gt;
  &lt;P&gt;there are several subqueries and several selfjoin etc required, please suggest how to implement this in bods.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2017 12:30:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/bods-how-to-implement-subquery/qaq-p/490755</guid>
      <dc:creator>former_member186160</dc:creator>
      <dc:date>2017-10-05T12:30:51Z</dc:date>
    </item>
    <item>
      <title>Re: bods: how to implement subquery</title>
      <link>https://community.sap.com/t5/technology-q-a/bods-how-to-implement-subquery/qaa-p/490756#M88280</link>
      <description>&lt;P&gt;Hi &lt;A href="https://answers.sap.com/users/6628/swethan5.html"&gt;Swetha N&lt;/A&gt;,&lt;/P&gt;
  &lt;P&gt; say you have a subquery like&lt;/P&gt;
  &lt;P&gt; select id,name from TABLE_A where id in (select id from TABLE_B);&lt;/P&gt;
  &lt;P&gt; step 1:- Take TABLE_A and TABLE_B as sources in a dataflow, &lt;/P&gt;
  &lt;P&gt;step 2:- Take a Query transform after TABLE_B and map only ID column in the schema_out.&lt;/P&gt;
  &lt;P&gt; step 3:- Take a Query transform after TABLE_A and map ID, NALE in the schema out.&lt;/P&gt;
  &lt;P&gt;step 4:- join Query of TABLE_A and Query of TABLE_B on column TABLE_A.ID=TABLE_A.ID.&lt;/P&gt;
  &lt;P&gt; in case of self join, take the table 2 times as sources in Dataflow and join.&lt;/P&gt;
  &lt;P&gt; Split that complicated query into several dataflows in BODS for better performance, dont try to do in a single dataflow. &lt;/P&gt;
  &lt;P&gt; If data is huge and you want to pushdown the query to database, then perform step 2 above in a dataflow and stage data in a table, and step 3 in a dataflow and stage data in a table and step 4 in a dataflow where you can join the the tables of step 2 and step 3 and full pushdown is possible. &lt;/P&gt;
  &lt;P&gt; Thanks,&lt;/P&gt;
  &lt;P&gt; Ravi kiran.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2017 15:22:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/bods-how-to-implement-subquery/qaa-p/490756#M88280</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-10-05T15:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: bods: how to implement subquery</title>
      <link>https://community.sap.com/t5/technology-q-a/bods-how-to-implement-subquery/qaa-p/490757#M88281</link>
      <description>&lt;P&gt;Hi Ravi,&lt;/P&gt;
  &lt;P&gt;i have many segments like in the below part of the code being repeated multiple times in my main query.&lt;/P&gt;
  &lt;P&gt;Please suggest the best approach to implement this in bods.&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/74578-zzzz.jpg" /&gt;&lt;/P&gt;
  &lt;P&gt;please note that the same table CL is called B and used again as Y.&lt;/P&gt;
  &lt;P&gt;Regards,&lt;/P&gt;
  &lt;P&gt;Swetha&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2017 16:46:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/bods-how-to-implement-subquery/qaa-p/490757#M88281</guid>
      <dc:creator>former_member186160</dc:creator>
      <dc:date>2017-10-05T16:46:38Z</dc:date>
    </item>
    <item>
      <title>Re: bods: how to implement subquery</title>
      <link>https://community.sap.com/t5/technology-q-a/bods-how-to-implement-subquery/qaa-p/490758#M88282</link>
      <description>&lt;P&gt;Don't start from the SQL statement, but from the logic behind it. What are the source data? What are the desired results? Once you've understood, you can easily implement that logic in a data flow.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 11:03:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/bods-how-to-implement-subquery/qaa-p/490758#M88282</guid>
      <dc:creator>former_member187605</dc:creator>
      <dc:date>2017-10-10T11:03:15Z</dc:date>
    </item>
    <item>
      <title>Re: bods: how to implement subquery</title>
      <link>https://community.sap.com/t5/technology-q-a/bods-how-to-implement-subquery/qaa-p/490759#M88283</link>
      <description>&lt;P&gt;Hi Dirk,&lt;/P&gt;
  &lt;P&gt;thanks for the suggestion, i will check on this direction.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 16:33:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/bods-how-to-implement-subquery/qaa-p/490759#M88283</guid>
      <dc:creator>former_member186160</dc:creator>
      <dc:date>2017-10-10T16:33:33Z</dc:date>
    </item>
    <item>
      <title>Re: bods: how to implement subquery</title>
      <link>https://community.sap.com/t5/technology-q-a/bods-how-to-implement-subquery/qaa-p/490760#M88284</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
  &lt;P&gt;If the inner query is repeated multiple times, you can use script and call sql function and store the value in variable.&lt;/P&gt;
  &lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2017 08:57:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/bods-how-to-implement-subquery/qaa-p/490760#M88284</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-10-16T08:57:55Z</dc:date>
    </item>
    <item>
      <title>Re: bods: how to implement subquery</title>
      <link>https://community.sap.com/t5/technology-q-a/bods-how-to-implement-subquery/qaa-p/490761#M88285</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
  &lt;P&gt;If the inner query is repeated multiple times, you can use script to call sql function and store the value in a variable. you can then use this variable.&lt;/P&gt;
  &lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2017 08:59:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/bods-how-to-implement-subquery/qaa-p/490761#M88285</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-10-16T08:59:59Z</dc:date>
    </item>
    <item>
      <title>Re: bods: how to implement subquery</title>
      <link>https://community.sap.com/t5/technology-q-a/bods-how-to-implement-subquery/qaa-p/490762#M88286</link>
      <description>&lt;P&gt;Hi Sweekriti,&lt;/P&gt;
  &lt;P&gt;thanks for your suggestion.&lt;/P&gt;
  &lt;P&gt;i meant same pattern is repeated but not the same text, so i cannot use the function call here.&lt;/P&gt;</description>
      <pubDate>Sun, 22 Oct 2017 12:39:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/bods-how-to-implement-subquery/qaa-p/490762#M88286</guid>
      <dc:creator>former_member186160</dc:creator>
      <dc:date>2017-10-22T12:39:55Z</dc:date>
    </item>
    <item>
      <title>Re: bods: how to implement subquery</title>
      <link>https://community.sap.com/t5/technology-q-a/bods-how-to-implement-subquery/qaa-p/490763#M88287</link>
      <description>&lt;P&gt;converting the sql to bods components became a huge dataflow, i am starting to test if the efforts are really worth the performance &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 22 Oct 2017 12:40:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/bods-how-to-implement-subquery/qaa-p/490763#M88287</guid>
      <dc:creator>former_member186160</dc:creator>
      <dc:date>2017-10-22T12:40:34Z</dc:date>
    </item>
    <item>
      <title>Re: bods: how to implement subquery</title>
      <link>https://community.sap.com/t5/technology-q-a/bods-how-to-implement-subquery/qaa-p/490764#M88288</link>
      <description>&lt;P&gt;thanks Dirk and Ravi for your answers.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Feb 2019 17:09:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/bods-how-to-implement-subquery/qaa-p/490764#M88288</guid>
      <dc:creator>former_member186160</dc:creator>
      <dc:date>2019-02-05T17:09:44Z</dc:date>
    </item>
  </channel>
</rss>

