Sunteți pe pagina 1din 2

Using Dimensions in Input and Output Contexts BusinessObjects (BO) performs calculations in reports.

To determine the result of an aggregate calculation BO defines an input context and an output context . Context : A context is made up of one or more dimensions. Input context: A formula s input context consists of the dimensions that feed into the formula. Input Context consists of one or more dimensions that are used in calculation. Output Context: A formula s output context causes the formula to output a value . Output Context consists of one or more dimensions that determine the result of t he calculation. IN, FORALL, FOREACH Using Context Operators in Input Contexts In previous examples you have used the In context operator to specify dimension( s) to include in the input and output contexts. BusinessObjects XI provides two additional context operators that can be used in extended syntax: ForEach The ForEach context operator allows you to add dimensions to the current default input context. For example, if a table contains the dimensions [Year] and [Quarter] and the measure [Revenue], the default context is [Year]; [Quarter ]. In the following example, the ForEach context operator is used to add the [Sa les Person] dimension to the context (without adding [Sales Person] to the table): =Min([Revenue] ForEach ([Sales Person])) In ([Year]) This would be the same as explicitly listing all of the dimensions as follows: =Min([Revenue] In ([Year];[Quarter];[Sales Person])) In ([Year]) ForAll The ForAll context operator allows you to remove a dimension from the cur rent default input context. For example, if a table contains the dimensions [Yea r], [Quarter] and [Sales Person] and the measure [Revenue], the default context is [ Year]; [Quarter]; [Sales Person]. In the following example, the ForAll context operator is used to remove the [Sales Person] dimension from the context (withou t removing [Sales Person] from the table): =Min([Revenue] ForAll ([Sales Person])) In ([Year]) This would be the same as explicitly listing all of the dimensions as follows: =Min([Revenue] In ([Year];[Quarter])) In ([Year]) ---------------Difference between <ForALL> & <ForEACH> ForEach is used to make include a dimension in a context. The calculation contex t is still affected by other values in the block. ForAll is used to exclude a dimension from a context. Other dimensions of the bl

ock will still be considered. Adding or removing values from a block might chang e the value, but it will always ignore the ForAll items.

S-ar putea să vă placă și