cancel
Showing results for 
Search instead for 
Did you mean: 

Webi report (ForAll & Foreach)

Former Member
0 Kudos

hi,

Can anyone give me idea about ForAll & Foreach in Webi report (give me example plz in details).

Regards,

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

ForEach context operator

The ForEach operator adds dimensions to a context.

Example: Using ForEach to add dimensions to a context

The following table shows the maximum revenue for each Quarter in a

report which contains the Quarter dimension but does not include it in the

block:

It is possible to create a formula for the Max Quarterly Revenue column

that does not include the ForEach operator:

Max ([Sales Revenue] In ([Year];[Quarter])) In ([Year])

Using the ForEach context operator, you can achieve the same result with

the following formula:

Max ([Sales Revenue] ForEach ([Quarter])) In ([Year])

Why? Because the Year dimension is the default input context in the block.

By using the ForEach operator, you add the Quarter dimension to the context,

giving an input context of ([Year];[Quarter]).

ForAll context operator

The ForAll context operator removes dimensions from a context.

Example: Using ForAll to remove dimensions from a context

You have a report showing Year, Quarter and Sales Revenue and you want

to add a column that shows the total revenue in each year, as shown in the

following block:

To total revenues by year the input context needs to be (Year); by default

it is (Year; Quarter). Therefore, you can remove Quarter from the input

context by specifying ForAll ([Quarter]) in the formula, which looks like this:

Sum([Sales Revenue] ForAll ([Quarter]))

Note that you can use the In operator to achieve the same thing; in this

case the formula is:

Sum([Sales Revenue] In ([Year]))

This version of the formula explicitly specifies Year as the context, rather

than removing Quarter to leave Year.

Simply,

Input Context: ForEach

Output Context: ForAll

Above is reference from WEBI User guide.

Regards,

Vamsee

Former Member
0 Kudos

Thanks for reply.

one more thing what do u mean of Input & Output Context in Webi Report, Bcz i knw context in the term of Universe but in case of webi report don't have idea.

Regards,

Former Member
0 Kudos

Thanks......................

Former Member
0 Kudos

Measures are projected on a Webi report, meaning they appear to "roll up" to a level determined by a list of dimensions. Input context is a way to set the set of dimensions used to roll up a measure before doing a calculation, and output context is a way to set the list of dimensions used after the calculation is done.

IN is used to provide a list of dimensions to be considered, and any other dimensions present in the block are ignored.

ForEach is used to add an extra dimension that might not be included in the block (which is valid only for input context).

ForAll is used to specifically exclude a dimension, as "all" values of that dimension are used.

I have a blog post with examples of IN on a report here:

http://www.dagira.com/2010/01/04/calculation-context-part-i-overview/

Your question has inspired me to finish the follow-up post for ForEach and ForAll, so I guess I will work on that next.

Former Member
0 Kudos

Hi Vamsee Krishna,

Very well explained in detail..

Former Member
0 Kudos

Does Filter Bar affect the results of the same if used in the conditional formatting?

Former Member
0 Kudos

Hi,

In universe Context is nothing but a path. Where as in Report level Context is about how to calculate the values using dimensions.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

You can get the idea about ForEach and Forall in the SAP Help

http://help.sap.com/businessobject/product_guides/boexir4/en/xi4sp5_ffc_en.pdf

Thanks and regards,

Sai Kiran