<?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: ABAP CDS view: use @DefaultAggregation: #FORMULA without @Analytics.query: true in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/abap-cds-view-use-defaultaggregation-formula-without-analytics-query-true/qaa-p/699084#M189337</link>
    <description>&lt;P&gt;I found a resolution to this (just in case anyone is still looking for one)&lt;/P&gt;&lt;P&gt;if you use the annotation  @AnalyticsDetails.query.formula you can enter an expression&lt;/P&gt;&lt;P&gt;e.g.:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;    @Aggregation.default: #FORMULA
    @AnalyticsDetails.query.formula: 'NDIV0(OrderDelivery.Volume / OrderDelivery.OrderCountDec ) * 100'
    @AnalyticsDetails.query.decimals: 2
    1                           as Percentage&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I hope this helps as I spent a while searching for a resolution to this and all I found was this unanswered post.&lt;/P&gt;&lt;P&gt;Leo&lt;/P&gt;</description>
    <pubDate>Fri, 14 Dec 2018 11:52:11 GMT</pubDate>
    <dc:creator>leogannon</dc:creator>
    <dc:date>2018-12-14T11:52:11Z</dc:date>
    <item>
      <title>ABAP CDS view: use @DefaultAggregation: #FORMULA without @Analytics.query: true</title>
      <link>https://community.sap.com/t5/technology-q-a/abap-cds-view-use-defaultaggregation-formula-without-analytics-query-true/qaq-p/699082</link>
      <description>&lt;P&gt;Dears,&lt;/P&gt;
  &lt;P&gt;I would like to create a consumption or composite ABAP CDS view with calculations that behave as a formula i.e. has to be calculated after the operands have been determined by aggregation or calculation. It should never be aggregated. Later on the front-end (BW or CDS query) the result of the calculations should change according the characteristics selected by the user (this is possible with Calc view calculated columns)&lt;/P&gt;
  &lt;P&gt;The problem is that calculation on CDS views by default are done at records level and aggregated, hence my idea was to use the @DefaultAggregation: #FORMULA annotation to get the desire result. However I only managed to make it work for abap cds queries (@Analytics.query: true), while for other CDS views, I got the "Element contains unsupported aggregation #FORMULA [Analytics]" error.&lt;/P&gt;
  &lt;P&gt;is this annotation supported by other types of ABAP CDS view? I would like to make those calculations before the queries.&lt;/P&gt;
  &lt;P&gt;Regards,&lt;/P&gt;
  &lt;P&gt;Antonio&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;BR /&gt;
  &lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 15:15:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/abap-cds-view-use-defaultaggregation-formula-without-analytics-query-true/qaq-p/699082</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-07-19T15:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP CDS view: use @DefaultAggregation: #FORMULA without @Analytics.query: true</title>
      <link>https://community.sap.com/t5/technology-q-a/abap-cds-view-use-defaultaggregation-formula-without-analytics-query-true/qaa-p/699083#M189336</link>
      <description>&lt;P&gt;did you find any solution ? I also have the same issue. &lt;/P&gt;&lt;P&gt;Sreehari &lt;/P&gt;</description>
      <pubDate>Sun, 09 Dec 2018 06:48:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/abap-cds-view-use-defaultaggregation-formula-without-analytics-query-true/qaa-p/699083#M189336</guid>
      <dc:creator>sreehari_vpillai</dc:creator>
      <dc:date>2018-12-09T06:48:02Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP CDS view: use @DefaultAggregation: #FORMULA without @Analytics.query: true</title>
      <link>https://community.sap.com/t5/technology-q-a/abap-cds-view-use-defaultaggregation-formula-without-analytics-query-true/qaa-p/699084#M189337</link>
      <description>&lt;P&gt;I found a resolution to this (just in case anyone is still looking for one)&lt;/P&gt;&lt;P&gt;if you use the annotation  @AnalyticsDetails.query.formula you can enter an expression&lt;/P&gt;&lt;P&gt;e.g.:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;    @Aggregation.default: #FORMULA
    @AnalyticsDetails.query.formula: 'NDIV0(OrderDelivery.Volume / OrderDelivery.OrderCountDec ) * 100'
    @AnalyticsDetails.query.decimals: 2
    1                           as Percentage&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I hope this helps as I spent a while searching for a resolution to this and all I found was this unanswered post.&lt;/P&gt;&lt;P&gt;Leo&lt;/P&gt;</description>
      <pubDate>Fri, 14 Dec 2018 11:52:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/abap-cds-view-use-defaultaggregation-formula-without-analytics-query-true/qaa-p/699084#M189337</guid>
      <dc:creator>leogannon</dc:creator>
      <dc:date>2018-12-14T11:52:11Z</dc:date>
    </item>
  </channel>
</rss>

