<?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: Convert WEBI report FORALL function into Equivalent SQL Logic in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/convert-webi-report-forall-function-into-equivalent-sql-logic/qaa-p/574960#M129251</link>
    <description>&lt;P&gt;Amit,&lt;/P&gt;
  &lt;P&gt;Thanks for the reply.&lt;/P&gt;
  &lt;P&gt;Even if i add FORALL objects in the Group By clause of sql statement, the result set in webi &amp;amp; SQL is different.&lt;/P&gt;</description>
    <pubDate>Sat, 21 Oct 2017 16:33:05 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2017-10-21T16:33:05Z</dc:date>
    <item>
      <title>Convert WEBI report FORALL function into Equivalent SQL Logic</title>
      <link>https://community.sap.com/t5/technology-q-a/convert-webi-report-forall-function-into-equivalent-sql-logic/qaq-p/574957</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
  &lt;P&gt;I am trying to convert webi formulas into equivalent Oracle SQL code. But I am confused when using some functions (FOREACH and &lt;STRONG&gt;FORALL&lt;/STRONG&gt;). Can anyone please look at the below formula and help me converting it into equivalent Oracle SQL code.&lt;/P&gt;
  &lt;P&gt;FYI, I am using BO 4.1 SP 9.&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;WEBI FORMULA 2:&lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;[Baseline text] = If([Baseline Identifier]=0) Then "Current Cost Baseline" Else If ([Baseline Identifier] =Max([Baseline Identifier]) &lt;STRONG&gt;ForAll&lt;/STRONG&gt;([Baseline Identifier];[Approval Date];[Finish FY Number];[FY1 Estimated Amount];[Total Estimated Amount] )) Then "Original Baseline" Else "Re-baseline"&lt;/P&gt;
  &lt;P&gt;(&lt;EM&gt;&lt;STRONG&gt;Universe Object SQL Definitions&lt;/STRONG&gt;:&lt;/EM&gt;&lt;/P&gt;
  &lt;P&gt;[[Baseline Identifier]= DW.CAPTL_INVMT_BSLINE.BASELINE_ID&lt;/P&gt;
  &lt;P&gt;[Approval Date]= DW.CAPTL_INVMT_BSLINE.APRVL_DT&lt;/P&gt;
  &lt;P&gt;[Finish FY Number]= DW.CAPTL_INVMT_BSLINE.FINISH_FY_NO&lt;/P&gt;
  &lt;P&gt;[FY1 Estimated Amount]= DW.CAPTL_INVMT_BSLINE.FY1_EST_AM&lt;/P&gt;
  &lt;P&gt;[Total Estimated Amount]= DW.CAPTL_INVMT_BSLINE.TOTAL_EST_AM&lt;/P&gt;
  &lt;P&gt;)&lt;/P&gt;
  &lt;P&gt;I was able to represent most of the formula in terms of SQL but I have some doubt in converting &lt;STRONG&gt;FORALL &lt;/STRONG&gt;function into SQL terms, can you please look into it and add the equivalent FORALL sql in the code below.&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;Oracle SQL:&lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;SELECT CASE WHEN DW.CAPTL_INVMT_BSLINE.BASELINE_ID=0 THEN 'Current Cost Baseline' WHEN (DW.CAPTL_INVMT_BSLINE.BASELINE_ID=MAX(DW.CAPTL_INVMT_BSLINE.BASELINE_ID)) THEN 'Original Baseline' Else 'Re-baseline' END AS "Baseline text" from DW.CAPTL_INVMT_BSLINE GROUP BY DW.CAPTL_INVMT_BSLINE.BASELINE_ID &lt;/P&gt;
  &lt;P&gt;-- FORALL - yet to add equivalent foreach function;&lt;/P&gt;
  &lt;P&gt;Thanks &amp;amp; Regards.&lt;/P&gt;
  &lt;P&gt;Naveen.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Oct 2017 15:24:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/convert-webi-report-forall-function-into-equivalent-sql-logic/qaq-p/574957</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-10-20T15:24:17Z</dc:date>
    </item>
    <item>
      <title>Re: Convert WEBI report FORALL function into Equivalent SQL Logic</title>
      <link>https://community.sap.com/t5/technology-q-a/convert-webi-report-forall-function-into-equivalent-sql-logic/qaa-p/574958#M129249</link>
      <description>&lt;P&gt;You can capture the actual Oracle SQL query for execution from webi tracing.&lt;/P&gt;
  &lt;P&gt;regards,&lt;/P&gt;
  &lt;P&gt;Jin-Chong&lt;/P&gt;</description>
      <pubDate>Fri, 20 Oct 2017 23:41:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/convert-webi-report-forall-function-into-equivalent-sql-logic/qaa-p/574958#M129249</guid>
      <dc:creator>former_member191664</dc:creator>
      <dc:date>2017-10-20T23:41:25Z</dc:date>
    </item>
    <item>
      <title>Re: Convert WEBI report FORALL function into Equivalent SQL Logic</title>
      <link>https://community.sap.com/t5/technology-q-a/convert-webi-report-forall-function-into-equivalent-sql-logic/qaa-p/574959#M129250</link>
      <description>&lt;P&gt;are you not getting desired result without adding forall objects in univers case statement?&lt;/P&gt;
  &lt;P&gt;If not then add all those objects in group by cla&lt;/P&gt;</description>
      <pubDate>Sat, 21 Oct 2017 14:20:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/convert-webi-report-forall-function-into-equivalent-sql-logic/qaa-p/574959#M129250</guid>
      <dc:creator>amitrathi239</dc:creator>
      <dc:date>2017-10-21T14:20:38Z</dc:date>
    </item>
    <item>
      <title>Re: Convert WEBI report FORALL function into Equivalent SQL Logic</title>
      <link>https://community.sap.com/t5/technology-q-a/convert-webi-report-forall-function-into-equivalent-sql-logic/qaa-p/574960#M129251</link>
      <description>&lt;P&gt;Amit,&lt;/P&gt;
  &lt;P&gt;Thanks for the reply.&lt;/P&gt;
  &lt;P&gt;Even if i add FORALL objects in the Group By clause of sql statement, the result set in webi &amp;amp; SQL is different.&lt;/P&gt;</description>
      <pubDate>Sat, 21 Oct 2017 16:33:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/convert-webi-report-forall-function-into-equivalent-sql-logic/qaa-p/574960#M129251</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-10-21T16:33:05Z</dc:date>
    </item>
    <item>
      <title>Re: Convert WEBI report FORALL function into Equivalent SQL Logic</title>
      <link>https://community.sap.com/t5/technology-q-a/convert-webi-report-forall-function-into-equivalent-sql-logic/qaa-p/574961#M129252</link>
      <description>&lt;P&gt;Thanks Jin-Chong for you reply but I am not an Admin for BO, so I can't do WEBI tracing and it will be almost impossible to get this from my admin. So if possible, can you please try one from your system by creating couple of WEBI formulas using FOREACH and FORALL functions and see what code the system generates.&lt;/P&gt;
  &lt;P&gt;Thanks for your time in helping me with this issue..&lt;/P&gt;
  &lt;P&gt;Naveen.&lt;/P&gt;</description>
      <pubDate>Sat, 21 Oct 2017 16:42:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/convert-webi-report-forall-function-into-equivalent-sql-logic/qaa-p/574961#M129252</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-10-21T16:42:29Z</dc:date>
    </item>
    <item>
      <title>Re: Convert WEBI report FORALL function into Equivalent SQL Logic</title>
      <link>https://community.sap.com/t5/technology-q-a/convert-webi-report-forall-function-into-equivalent-sql-logic/qaa-p/574962#M129253</link>
      <description>&lt;P&gt;Forall context is same as group by clause in sql.even I don't think so these objects are required in oracle case statement.create object in universe with case statement and try.&lt;/P&gt;
  &lt;P&gt;Check attached link for to understand different context&lt;/P&gt;
  &lt;P&gt;&lt;A href="http://www.dagira.com/2010/01/04/calculation-context-part-i-overview/" target="test_blank"&gt;http://www.dagira.com/2010/01/04/calculation-context-part-i-overview/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Oct 2017 16:50:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/convert-webi-report-forall-function-into-equivalent-sql-logic/qaa-p/574962#M129253</guid>
      <dc:creator>amitrathi239</dc:creator>
      <dc:date>2017-10-21T16:50:47Z</dc:date>
    </item>
    <item>
      <title>Re: Convert WEBI report FORALL function into Equivalent SQL Logic</title>
      <link>https://community.sap.com/t5/technology-q-a/convert-webi-report-forall-function-into-equivalent-sql-logic/qaa-p/574963#M129254</link>
      <description>&lt;P&gt;Amit,&lt;/P&gt;
  &lt;P&gt;I am not trying to achieve this FORALL context formula in Universe. I have a requirement to convert all the webi formulas into SQL, so that we can include them in database views.&lt;/P&gt;
  &lt;P&gt;If possible can you provide me a example by converting webi formulas into SQL by using FORALL &amp;amp; FOREACH.&lt;/P&gt;
  &lt;P&gt;Thanks &amp;amp; Regards.&lt;/P&gt;
  &lt;P&gt;Naveen.&lt;/P&gt;</description>
      <pubDate>Sat, 21 Oct 2017 17:27:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/convert-webi-report-forall-function-into-equivalent-sql-logic/qaa-p/574963#M129254</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-10-21T17:27:16Z</dc:date>
    </item>
    <item>
      <title>Re: Convert WEBI report FORALL function into Equivalent SQL Logic</title>
      <link>https://community.sap.com/t5/technology-q-a/convert-webi-report-forall-function-into-equivalent-sql-logic/qaa-p/574964#M129255</link>
      <description>&lt;P&gt;Try adding like below&lt;/P&gt;
  &lt;P&gt;ForAll - Remove necessary entity(Dimensions) in Groupby Clause&lt;/P&gt;
  &lt;P&gt;Foreach - Include those entities in Groupby Clause&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2017 09:55:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/convert-webi-report-forall-function-into-equivalent-sql-logic/qaa-p/574964#M129255</guid>
      <dc:creator>former_member45129</dc:creator>
      <dc:date>2017-10-23T09:55:25Z</dc:date>
    </item>
  </channel>
</rss>

