CDS: How to use @AnalyticsDetails.elimination annotation to eliminate the internal business volume

Estimated read time 8 min read

This blog is about how to use @AnalyticsDetails.elimination to eliminate the internal business volume when executing an analytical query.

Internal business volume

When revenues made between two subsidiaries of company, for company’s total revenue, these revenues should not be considered, as transaction is happening within the company. For example, a company is divided into several subsidiaries. These subsidiaries are divided into further subsidiaries. This means there exists a hierarchy of subsidiaries. Subsidiaries are selling products to each other. For each subsidiary this is external sales. But for a parent subsidiary this is just internal sales, as both subsidiaries are descendants. By using this annotation, revenues made between two subsidiaries in an organization are no longer displayed.

More information about the concept can be found Elimination of Internal Business Volume | SAP Help Portal

Syntax

elimination: {

     pair : array of {

       dimension1: String(30);

       dimension2: String(30);

     }

     rule : String(20) enum { ELIMINATE_IF_ALL; ELIMINATE_IF_ONE; };

   }

The annotation can be used in cube-views (Analytics.dataCategory: #CUBE) or in analytical queries (define transient view entity with provider contract analytical query).

pair: this list defines the pairs (dimension1 and dimension2) which are checked for elimination. Both dimensions have needed a foreign key association to the same target view. If the annotation is used on cube level, both dimensions must be elements of the cube. If the annotation is used in an analytical query, both dimensions must be part of the source cube view.rule: if set to #ELIMINATE_IF_ALL, then the volume is eliminated if all pairs are internal. If set to #ELIMINATE_IF_ONE the volume is eliminated if at least one pair is internal. If “rule” is not set, the AND-logic (ELIMINATE_IF_ALL) is applied.

Example 

Following example displays the number of seat booked in flight according to the elimination rule specified on destination airport, departure airport, destination country, departure country.

 

@AccessControl.authorizationCheck: #NOT_ALLOWED
@EndUserText.label: ‘Elimination of Internal Busniess volumn’
@ObjectModel.modelingPattern: #ANALYTICAL_QUERY
@ObjectModel.supportedCapabilities: [#ANALYTICAL_QUERY]
define transient view entity ZLR_PC_FLIGHTICE_SIMPLE
provider contract analytical_query
as projection on ZOQ_FLIGHT_ICE
{

_airportfrom._hier( p_HierarchyID : ‘GEO’ ) as _airportFromHier,
@Consumption.hidden: true
_airportfrom.AirportID as dummyAirportFrom,

_airportto._hier( p_HierarchyID : ‘GEO’ ) as _airportToHier,
@Consumption.hidden: true
_airportto.AirportID as dummyAirportTo,

@AnalyticsDetails.query: {
axis: #ROWS,
displayHierarchy: #ON,
hierarchyAssociation: ‘_airportFromHier’
}

airportfrom,

@AnalyticsDetails.query: {
axis: #ROWS,
displayHierarchy: #ON,
hierarchyAssociation: ‘_airportToHier’
}
airportto,

@Consumption.filter.defaultValue: ‘DE’
@AnalyticsDetails.query.axis: #ROWS
countryfrom,

@AnalyticsDetails.query.axis: #ROWS
countryto,

seatsmax,

@AnalyticsDetails.elimination: {
pair: [{ dimension1 : ‘countryfrom’ , dimension2: ‘countryto’ }]
}
@EndUserText.label: ‘SeatsMax Q-ICE country’
seatsmax as seatsmaxICEQ_C,

@AnalyticsDetails.elimination:{
pair: [ { dimension1 : ‘airportfrom’ , dimension2: ‘airportto’ },
{ dimension1 : ‘countryfrom’ , dimension2: ‘countryto’ } ],
rule: #ELIMINATE_IF_ALL
}
@EndUserText.label: ‘SeatsMax Q-ICE airport and country’
seatsmax as seatsmaxICEQ_AC,

@AnalyticsDetails.elimination:{
pair: [ { dimension1 : ‘airportfrom’ , dimension2: ‘airportto’ },
{ dimension1 : ‘countryfrom’ , dimension2: ‘countryto’ } ],
rule: #ELIMINATE_IF_ONE
}
@EndUserText.label: ‘SeatsMax Q-ICE airport or country’
seatsmax as seatsmaxICEQ_A_C

}

 

Output

 

In this example for columns (cells marked with colour): 

SeatsMax Q-ICE country – elimination pair mentioned as ‘countryfrom’ and ‘countryto’. Therefore, there is no entry where departure country and destination country are same.

SeatsMax Q-ICE airport and country- elimination pairs are ‘airportfrom’ and ‘airportto’, ‘countryfrom’ and ‘countryto’ And rule as #ELIMINATE_IF_ALL, Therefore, there is no entry where destination airport and departure airport are same AND destination country and departure country are same.

SeatsMax Q-ICE airport or country – elimination pairs are ‘airportfrom’ and ‘airportto’, ‘countryfrom’ and ‘countryto’ And rule as #ELIMINATE_IF_ONE, Therefore, there is no entry where destination airport and departure airport are same OR destination country and departure country are same.

 

Constraints

The annotation can be used in cubes or in queries.

The dimension names in one pair (AnalyticsDetails.elimination.pair) must have a foreign key association to the same dimension view and this dimension view must have an hierarchy association.In the query definition:It is not necessary that any of the dimensions in the list of pairs is part of the queryIf a hierarchy is assigned to a dimension, then the pair dimension must be assigned to the same hierarchy or must be without hierarchyIf a dimension is not in drill down, then the condition of the one pair is always true (independent of the value of the other dimension of the pair). The same is true on totals/subtotal lines.

 

 

​ This blog is about how to use @AnalyticsDetails.elimination to eliminate the internal business volume when executing an analytical query.Internal business volumeWhen revenues made between two subsidiaries of company, for company’s total revenue, these revenues should not be considered, as transaction is happening within the company. For example, a company is divided into several subsidiaries. These subsidiaries are divided into further subsidiaries. This means there exists a hierarchy of subsidiaries. Subsidiaries are selling products to each other. For each subsidiary this is external sales. But for a parent subsidiary this is just internal sales, as both subsidiaries are descendants. By using this annotation, revenues made between two subsidiaries in an organization are no longer displayed.More information about the concept can be found Elimination of Internal Business Volume | SAP Help PortalSyntaxelimination: {     pair : array of {       dimension1: String(30);       dimension2: String(30);     }     rule : String(20) enum { ELIMINATE_IF_ALL; ELIMINATE_IF_ONE; };   }The annotation can be used in cube-views (Analytics.dataCategory: #CUBE) or in analytical queries (define transient view entity with provider contract analytical query).pair: this list defines the pairs (dimension1 and dimension2) which are checked for elimination. Both dimensions have needed a foreign key association to the same target view. If the annotation is used on cube level, both dimensions must be elements of the cube. If the annotation is used in an analytical query, both dimensions must be part of the source cube view.rule: if set to #ELIMINATE_IF_ALL, then the volume is eliminated if all pairs are internal. If set to #ELIMINATE_IF_ONE the volume is eliminated if at least one pair is internal. If “rule” is not set, the AND-logic (ELIMINATE_IF_ALL) is applied.Example Following example displays the number of seat booked in flight according to the elimination rule specified on destination airport, departure airport, destination country, departure country. @AccessControl.authorizationCheck: #NOT_ALLOWED
@EndUserText.label: ‘Elimination of Internal Busniess volumn’
@ObjectModel.modelingPattern: #ANALYTICAL_QUERY
@ObjectModel.supportedCapabilities: [#ANALYTICAL_QUERY]
define transient view entity ZLR_PC_FLIGHTICE_SIMPLE
provider contract analytical_query
as projection on ZOQ_FLIGHT_ICE
{

_airportfrom._hier( p_HierarchyID : ‘GEO’ ) as _airportFromHier,
@Consumption.hidden: true
_airportfrom.AirportID as dummyAirportFrom,

_airportto._hier( p_HierarchyID : ‘GEO’ ) as _airportToHier,
@Consumption.hidden: true
_airportto.AirportID as dummyAirportTo,

@AnalyticsDetails.query: {
axis: #ROWS,
displayHierarchy: #ON,
hierarchyAssociation: ‘_airportFromHier’
}

airportfrom,

@AnalyticsDetails.query: {
axis: #ROWS,
displayHierarchy: #ON,
hierarchyAssociation: ‘_airportToHier’
}
airportto,

@Consumption.filter.defaultValue: ‘DE’
@AnalyticsDetails.query.axis: #ROWS
countryfrom,

@AnalyticsDetails.query.axis: #ROWS
countryto,

seatsmax,

@AnalyticsDetails.elimination: {
pair: [{ dimension1 : ‘countryfrom’ , dimension2: ‘countryto’ }]
}
@EndUserText.label: ‘SeatsMax Q-ICE country’
seatsmax as seatsmaxICEQ_C,

@AnalyticsDetails.elimination:{
pair: [ { dimension1 : ‘airportfrom’ , dimension2: ‘airportto’ },
{ dimension1 : ‘countryfrom’ , dimension2: ‘countryto’ } ],
rule: #ELIMINATE_IF_ALL
}
@EndUserText.label: ‘SeatsMax Q-ICE airport and country’
seatsmax as seatsmaxICEQ_AC,

@AnalyticsDetails.elimination:{
pair: [ { dimension1 : ‘airportfrom’ , dimension2: ‘airportto’ },
{ dimension1 : ‘countryfrom’ , dimension2: ‘countryto’ } ],
rule: #ELIMINATE_IF_ONE
}
@EndUserText.label: ‘SeatsMax Q-ICE airport or country’
seatsmax as seatsmaxICEQ_A_C

} Output  In this example for columns (cells marked with colour): SeatsMax Q-ICE country – elimination pair mentioned as ‘countryfrom’ and ‘countryto’. Therefore, there is no entry where departure country and destination country are same.SeatsMax Q-ICE airport and country- elimination pairs are ‘airportfrom’ and ‘airportto’, ‘countryfrom’ and ‘countryto’ And rule as #ELIMINATE_IF_ALL, Therefore, there is no entry where destination airport and departure airport are same AND destination country and departure country are same.SeatsMax Q-ICE airport or country – elimination pairs are ‘airportfrom’ and ‘airportto’, ‘countryfrom’ and ‘countryto’ And rule as #ELIMINATE_IF_ONE, Therefore, there is no entry where destination airport and departure airport are same OR destination country and departure country are same. ConstraintsThe annotation can be used in cubes or in queries.The dimension names in one pair (AnalyticsDetails.elimination.pair) must have a foreign key association to the same dimension view and this dimension view must have an hierarchy association.In the query definition:It is not necessary that any of the dimensions in the list of pairs is part of the queryIf a hierarchy is assigned to a dimension, then the pair dimension must be assigned to the same hierarchy or must be without hierarchyIf a dimension is not in drill down, then the condition of the one pair is always true (independent of the value of the other dimension of the pair). The same is true on totals/subtotal lines.    Read More Technology Blog Posts by SAP articles 

#SAP

#SAPTechnologyblog

You May Also Like

More From Author

84% of Humanity Has Never Used AI. Here’s Why That Number Should Scare You — and Excite You.The AI revolution isn’t here yet. It’s loading.Open your Twitter feed, your LinkedIn, your YouTube recommendations. AI is everywhere, right? Every headline screams that the world has changed. Investors are pouring billions into it. Pundits say it’ll replace half of all jobs by 2030.But zoom out. Like, really zoom out.Picture 8.1 billion dots. Each one is a human being. Now color-code them by how advanced their AI interaction actually is.Here’s what you’d see.A Sea of Gray84% of humanity — 6.8 billion people — have never used an AI tool. Not once.Not ChatGPT. Not Gemini. Not even a basic AI chatbot on a customer service page. Nothing.That’s not a rounding error. That’s almost every human being alive.We talk about AI like it’s oxygen — invisible and everywhere. But for most of the world, AI is still science fiction. It’s something they’ve heard about, maybe seen in a news segment, but never touched. They’re not resisting it. It simply hasn’t reached them yet.That gray is overwhelming. And it tells a story most people in the AI conversation completely miss.The Green Sliver at the Bottom16% — about 1.3 billion people — have used a free AI chatbot.This is the group that typed a question into ChatGPT once. Maybe used it to write a birthday message or settle a dinner table argument. They’ve dipped a toe in.This is what the mainstream media calls “the AI revolution.”A single conversation. A curiosity click. A “wow, that’s cool” moment before they closed the tab and never went back.That’s the ceiling for most people who’ve touched AI at all. And it’s still only 1 in 6 humans on the planet.The Tiny Yellow Band0.3% — somewhere between 15 and 60 million people — pay for AI.This is where it gets interesting. If you’re reading this on Medium, there’s a solid chance you’re in this group. You’ve got a ChatGPT Plus subscription, maybe Claude Pro, maybe Perplexity. You use AI regularly. You’ve seen what it can actually do when you push it.You feel like you’re part of something mainstream because everyone you know seems to be using it.They’re not. You are surrounded by a bubble of early adopters so thick that it feels like the whole world — but it’s 3 out of every 1,000 people on Earth.Let that sit for a second.The Nearly Invisible Red0.04% — roughly 2 to 5 million people — are using AI to build.Cursor. GitHub Copilot. AI coding scaffolds. Agentic workflows. These are people who aren’t just asking AI questions — they’re using it as a co-pilot to create things: software, products, companies, systems.This is AI at its highest current level of human interaction.And it’s so small on the chart that you almost can’t see it.What This Actually MeansHere’s the uncomfortable truth the tech industry doesn’t want to say too loudly:We are not in the AI age. We are in the “early adopters telling everyone it’s the AI age” age.The real wave hasn’t hit. Not even close.Think about the early internet. In 1995, a tiny fraction of people had ever visited a website. The people who got it early — who built skills, products, and audiences while everyone else shrugged — went on to define the next 30 years of business and culture.AI is at that exact moment right now.The gap between the 0.04% who build with AI and the 84% who’ve never touched it is not just a statistic. It’s the largest skills arbitrage opportunity most of us will ever see in our lifetimes.The Three Windows AheadHistory shows us there are three windows in any technological shift:The Builder Window — the 0.04% who create tools and systems with the technologyThe Learner Window — the people who deeply understand and fluently use it before the masses arriveThe Passenger Window — everyone else, who eventually adopts it because they have no choice, but on someone else’s termsRight now, windows 1 and 2 are still wide open.The people developing genuine AI fluency today — not “I asked ChatGPT for a recipe” fluency, but deep, workflow-integrated, problem-solving fluency — are building an advantage that will compound for years.Which Dot Are You?Look at that chart one more time.If you’re reading this article, you’re already ahead of 84% of the world just by paying attention. The question is what you do with the next 6 months.The gray dots aren’t your competition. They’re your future audience, your future customers, your future employees who will need someone to show them how this works.The red dots aren’t unreachable gods. They’re mostly just people who started earlier and stayed curious longer.The distance between where you are and where the opportunity is isn’t talent. It’s not even time.It’s intentionality.Which dot are you right now — and which one do you want to be by the end of the year? Drop it in the comments.Tags: Artificial Intelligence · Technology · Future Of Work · Productivity · ChatGPT

84% of Humanity Has Never Used AI. Here’s Why That Number Should Scare You — and Excite You.The AI revolution isn’t here yet. It’s loading.Open your Twitter feed, your LinkedIn, your YouTube recommendations. AI is everywhere, right? Every headline screams that the world has changed. Investors are pouring billions into it. Pundits say it’ll replace half of all jobs by 2030.But zoom out. Like, really zoom out.Picture 8.1 billion dots. Each one is a human being. Now color-code them by how advanced their AI interaction actually is.Here’s what you’d see.A Sea of Gray84% of humanity — 6.8 billion people — have never used an AI tool. Not once.Not ChatGPT. Not Gemini. Not even a basic AI chatbot on a customer service page. Nothing.That’s not a rounding error. That’s almost every human being alive.We talk about AI like it’s oxygen — invisible and everywhere. But for most of the world, AI is still science fiction. It’s something they’ve heard about, maybe seen in a news segment, but never touched. They’re not resisting it. It simply hasn’t reached them yet.That gray is overwhelming. And it tells a story most people in the AI conversation completely miss.The Green Sliver at the Bottom16% — about 1.3 billion people — have used a free AI chatbot.This is the group that typed a question into ChatGPT once. Maybe used it to write a birthday message or settle a dinner table argument. They’ve dipped a toe in.This is what the mainstream media calls “the AI revolution.”A single conversation. A curiosity click. A “wow, that’s cool” moment before they closed the tab and never went back.That’s the ceiling for most people who’ve touched AI at all. And it’s still only 1 in 6 humans on the planet.The Tiny Yellow Band0.3% — somewhere between 15 and 60 million people — pay for AI.This is where it gets interesting. If you’re reading this on Medium, there’s a solid chance you’re in this group. You’ve got a ChatGPT Plus subscription, maybe Claude Pro, maybe Perplexity. You use AI regularly. You’ve seen what it can actually do when you push it.You feel like you’re part of something mainstream because everyone you know seems to be using it.They’re not. You are surrounded by a bubble of early adopters so thick that it feels like the whole world — but it’s 3 out of every 1,000 people on Earth.Let that sit for a second.The Nearly Invisible Red0.04% — roughly 2 to 5 million people — are using AI to build.Cursor. GitHub Copilot. AI coding scaffolds. Agentic workflows. These are people who aren’t just asking AI questions — they’re using it as a co-pilot to create things: software, products, companies, systems.This is AI at its highest current level of human interaction.And it’s so small on the chart that you almost can’t see it.What This Actually MeansHere’s the uncomfortable truth the tech industry doesn’t want to say too loudly:We are not in the AI age. We are in the “early adopters telling everyone it’s the AI age” age.The real wave hasn’t hit. Not even close.Think about the early internet. In 1995, a tiny fraction of people had ever visited a website. The people who got it early — who built skills, products, and audiences while everyone else shrugged — went on to define the next 30 years of business and culture.AI is at that exact moment right now.The gap between the 0.04% who build with AI and the 84% who’ve never touched it is not just a statistic. It’s the largest skills arbitrage opportunity most of us will ever see in our lifetimes.The Three Windows AheadHistory shows us there are three windows in any technological shift:The Builder Window — the 0.04% who create tools and systems with the technologyThe Learner Window — the people who deeply understand and fluently use it before the masses arriveThe Passenger Window — everyone else, who eventually adopts it because they have no choice, but on someone else’s termsRight now, windows 1 and 2 are still wide open.The people developing genuine AI fluency today — not “I asked ChatGPT for a recipe” fluency, but deep, workflow-integrated, problem-solving fluency — are building an advantage that will compound for years.Which Dot Are You?Look at that chart one more time.If you’re reading this article, you’re already ahead of 84% of the world just by paying attention. The question is what you do with the next 6 months.The gray dots aren’t your competition. They’re your future audience, your future customers, your future employees who will need someone to show them how this works.The red dots aren’t unreachable gods. They’re mostly just people who started earlier and stayed curious longer.The distance between where you are and where the opportunity is isn’t talent. It’s not even time.It’s intentionality.Which dot are you right now — and which one do you want to be by the end of the year? Drop it in the comments.Tags: Artificial Intelligence · Technology · Future Of Work · Productivity · ChatGPT