## dinsdag, maart 08, 2005

### Context operators in Business Objects (part 1)

This is quite a topic. It is not covered in any of the courses, but the possibilities it offers are quite impressive.
• in
• Foreach
• Forall
• in Body
• in Block
• in Report
• currentpage
In this first part, I shall be explaining the In operator.
Let’s say you show a table (based on the e-Fashion Universe) containing Year, Quarter and Sales Revenue. As a default, the Sales Revenue is shown “in the context” of Year and Quarter. If you were to create a table with only the year and Sales Revenue, then the context of the Sales Revenue would be the Year. This is what we call the “Input Context”.
When you create a table, containing Year, Quarter and Sales Revenue and you create a Break on the table. next you create a sum on the Sales Revenue, then BO will write a sum at the end of each Year. This is called the “Output context”.

Let’s now say that you need to show that minimum in an extra column, so you can compare the Sales Revenue to the Minimum Sales Revenue for that Year.
Then the formula would be :
Min(<Sales Revenue> In (<Year>,<Quarter>)) In <Year>
The first “In” indicates that the Minimum Sales Revenue has to be calculated in function of Year and Quarter, but has to be shown by Year, which is taken care of by the second “In” operator.
In a next item : Foreach and Forall