In last weeks’ blog post I discussed the syntax for the ForEach formula in Webi. This week, I will discuss the use of the ForAll formula. ForAll is one of three context operators in Webi (the other two are “IN” and “ForEach”).
The ForAll operators allows removing extra dimensions from the existing input context.
Consider the table below containing a list of Customer numbers and their respective invoices. Let’s say we want to count invoices for all customer where the invoice volume is greater than 10.
Here is the formula for doing so
=Sum(Count([Invoice No]) ForAll([Invoice No];[Customer Number]) Where ([Volume CY YTD]>10))
I will create a new measure and input the formula above within it.
Then I will drag that measure next to the “Invoice No” column. Here is the outcome.
As you could observe the formula is correctly counting the invoices that meet the defined requirements.