<?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: Writing Alias column using select query in Calc View using CE functions in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/writing-alias-column-using-select-query-in-calc-view-using-ce-functions/qaa-p/8798843#M3122829</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ravi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes , I agree with you&amp;nbsp; ,Hope there would be more functionalities supporting with CE functions,otherwise we can't get the whole advantage I believe,because in real-time most of the requirements would be complex.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for patiently answering my questions,may be some questions look silly .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Santosh Varada&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 04 Jun 2012 19:24:33 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2012-06-04T19:24:33Z</dc:date>
    <item>
      <title>Writing Alias column using select query in Calc View using CE functions</title>
      <link>https://community.sap.com/t5/technology-q-a/writing-alias-column-using-select-query-in-calc-view-using-ce-functions/qaq-p/8798837</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I am trying to derive a new column out of exisiting columns by using select query on CE function CE_CALC_VIEW as mentioned below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BEGIN &lt;/P&gt;&lt;P&gt; var_out =CE_CALC_VIEW("_SYS_BIC"."zhanajlr/CRM_JLR_CE_VISIT_CALCVIEW",["NAME_FIRST",&lt;/P&gt;&lt;P&gt; "PARTNER","TELNR_LONG","NAME_LAST","SMTP_ADDR","CITY1","COUNTRY",&lt;/P&gt;&lt;P&gt; "DESIGNATIONTEXT","INDUSTRYTEXT","AGE_GROUP","VISITID","VISITDATE",&lt;/P&gt;&lt;P&gt;"VISITPRODUCT","PRODUCTTYPE","PRODUCTMODEL","VISITTYPE","PRICE",&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;select count(VISITID) group by VISITPRODUCT as "VISITCOUNT"&lt;/STRONG&gt;]); &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; END&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but I am facing error as below&amp;nbsp; incorrect syntax near "select": line 8 col 1 (at pos 559)nSet Schema DDL statement: set schema Type DDL:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can we achieve same using calculated attributes&amp;nbsp; or I am missing any syntax , request suggetions in solving the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Santosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jun 2012 06:46:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/writing-alias-column-using-select-query-in-calc-view-using-ce-functions/qaq-p/8798837</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-06-04T06:46:33Z</dc:date>
    </item>
    <item>
      <title>Re: Writing Alias column using select query in Calc View using CE functions</title>
      <link>https://community.sap.com/t5/technology-q-a/writing-alias-column-using-select-query-in-calc-view-using-ce-functions/qaa-p/8798838#M3122824</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you need to use CE_AGGREGATION function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please try with CE_AGGREGATION (&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;"_SYS_BIC"."zhanajlr/CRM_JLR_CE_VISIT_CALCVIEW"&lt;/SPAN&gt;, [count(&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;"VISITID"&lt;/SPAN&gt; AS &lt;STRONG style="font-size: 12px; background-color: #ffffff; color: #333333;"&gt;"VISITCOUNT"]&lt;/STRONG&gt;, ["&lt;STRONG style="font-size: 12px; background-color: #ffffff; color: #333333;"&gt;VISITPRODUCT&lt;/STRONG&gt;"]);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please refer to page 30 of the SQL script manual for details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jun 2012 08:14:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/writing-alias-column-using-select-query-in-calc-view-using-ce-functions/qaa-p/8798838#M3122824</guid>
      <dc:creator>Ravi_Channe</dc:creator>
      <dc:date>2012-06-04T08:14:47Z</dc:date>
    </item>
    <item>
      <title>Re: Writing Alias column using select query in Calc View using CE functions</title>
      <link>https://community.sap.com/t5/technology-q-a/writing-alias-column-using-select-query-in-calc-view-using-ce-functions/qaa-p/8798839#M3122825</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ravi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I have tried that option , there is one catch , you can't pass the calcview name directly ,we need to get the result data into the temporary table directly ,then we can use the variable as input for Aggregation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TEMP = CE_CALC_VIEW("_SYS_BIC"."zhanajlr/CRM_JLR_CE_VISIT_CALCVIEW",["NAME_FIRST",&lt;/P&gt;&lt;P&gt; "PARTNER","TELNR_LONG","NAME_LAST","SMTP_ADDR","CITY1","COUNTRY",&lt;/P&gt;&lt;P&gt; "DESIGNATIONTEXT","INDUSTRYTEXT","AGE_GROUP","VISITID","VISITDATE",&lt;/P&gt;&lt;P&gt;"VISITPRODUCT","PRODUCTTYPE","PRODUCTMODEL","VISITTYPE","PRICE"]); &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; var_out = CE_AGGREGATION (:TEMP, &lt;/P&gt;&lt;P&gt; [ count("VISITID") AS "VISITCOUNT"], ["VISITPRODUCT"]); &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the problems with the CE_AGGREGATION functions are&lt;/P&gt;&lt;P&gt;1.what ever we want to show it in output it needs to be part of Group by clause&amp;nbsp; here it is in the square brackets,otherwise we can't get the column in the output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.count(DISTINCT "VISITID") is not supported feature, if I want to avoid duplicates ,how can I achieve that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3.I tried the below to use nested concept,meaning using CE_AGGREGATION as part of CE_CALCVIEW&amp;nbsp; as below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var_out = CE_CALC_VIEW("_SYS_BIC"."zhanajlr/CRM_JLR_CE_VISIT_CALCVIEW",&lt;/P&gt;&lt;P&gt; ["PARTNER",CE_AGGREGATION(:TEMP, [count("VISITID") AS "VISITCOUNT"], ["VISITPRODUCT"])]); &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but it is also not working .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Request your suggetions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Santosh Varada&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jun 2012 11:09:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/writing-alias-column-using-select-query-in-calc-view-using-ce-functions/qaa-p/8798839#M3122825</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-06-04T11:09:16Z</dc:date>
    </item>
    <item>
      <title>Re: Writing Alias column using select query in Calc View using CE functions</title>
      <link>https://community.sap.com/t5/technology-q-a/writing-alias-column-using-select-query-in-calc-view-using-ce-functions/qaa-p/8798840#M3122826</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Santosh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I haven't tried this myself, but one suggestion is to use two different CALC_VIEWs. One for all the columns and one for count. Then using the CE_JOIN you can join both the views.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As mentioned earlier, I haven't tried this myself, but see if it can work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jun 2012 17:55:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/writing-alias-column-using-select-query-in-calc-view-using-ce-functions/qaa-p/8798840#M3122826</guid>
      <dc:creator>Ravi_Channe</dc:creator>
      <dc:date>2012-06-04T17:55:22Z</dc:date>
    </item>
    <item>
      <title>Re: Writing Alias column using select query in Calc View using CE functions</title>
      <link>https://community.sap.com/t5/technology-q-a/writing-alias-column-using-select-query-in-calc-view-using-ce-functions/qaa-p/8798841#M3122827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ravi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I tried as per your suggestion it is working, but the problem of duplicate rows I could not resolve even at this stage,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even though the Join gives result, it seems to be a complex data model as I have to built Attribute views,calculation views on top of those attribute views and again one more calculation view on top of existing calculation views,no.of layers are being increased, if&amp;nbsp; the aggregation can be achieved using any of the CE_CALC functions we can reduce one layer.Also in the aggregation or in any of the CE functions we can't use DISTINCT function it seems.Request your thoughts around this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Santosh Varada&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jun 2012 18:42:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/writing-alias-column-using-select-query-in-calc-view-using-ce-functions/qaa-p/8798841#M3122827</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-06-04T18:42:04Z</dc:date>
    </item>
    <item>
      <title>Re: Writing Alias column using select query in Calc View using CE functions</title>
      <link>https://community.sap.com/t5/technology-q-a/writing-alias-column-using-select-query-in-calc-view-using-ce-functions/qaa-p/8798842#M3122828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Santosh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are trying to implement a complex business logic using CE functions. Although these functions are optimized for performance as are executed directly by Calc Engine bypassing SQL Parser and Engine, I personally feel they do not provide complex functionalities like correlated joins (nested joins) or complex restrictions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your requirement may not be fulfilled in a simple way, but you can try the combination of SQL views (for count distinct) and CE views.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It may be very performance optimized, but till the CE functions mature (which I am sure they will), we will have to use the workarounds.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jun 2012 19:08:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/writing-alias-column-using-select-query-in-calc-view-using-ce-functions/qaa-p/8798842#M3122828</guid>
      <dc:creator>Ravi_Channe</dc:creator>
      <dc:date>2012-06-04T19:08:04Z</dc:date>
    </item>
    <item>
      <title>Re: Writing Alias column using select query in Calc View using CE functions</title>
      <link>https://community.sap.com/t5/technology-q-a/writing-alias-column-using-select-query-in-calc-view-using-ce-functions/qaa-p/8798843#M3122829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ravi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes , I agree with you&amp;nbsp; ,Hope there would be more functionalities supporting with CE functions,otherwise we can't get the whole advantage I believe,because in real-time most of the requirements would be complex.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for patiently answering my questions,may be some questions look silly .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Santosh Varada&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jun 2012 19:24:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/writing-alias-column-using-select-query-in-calc-view-using-ce-functions/qaa-p/8798843#M3122829</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-06-04T19:24:33Z</dc:date>
    </item>
  </channel>
</rss>

