1

So I have a column with this data

1
1
1
2
3
4
5
5
5

How can I do a count if where the value at any given location in the above table is equal to a cell I select? i.e. doing Count([NUMBER]) Where([NUMBER] = Coordinates(0,0)) would return 3, because there are 3 rows where the value is one in the 0 position.

It's basically like in excel where you can do COUNTIF(A:A, 1) and it would give you the total number of rows where the value in A:A is 1. Is this possible to do in business objects web intelligence?

1 Answer 1

2

Functions in WebI operate on rows, so you have to think about it a little differently.

If your intent is to create a cell outside of the report block and display the count of specific values, you can use Count() with Where():

=Count([NUMBER];All)  Where ([NUMBER] = "1")

In a freestanding cell, the above will produce a value of "3" for your sample data.

If you want to put the result in the same block and have it count up the occurrences of values on that row, for example:

NUMBER    NUMBER Total
1         3
1         3
1         3
2         1
3         1
4         1
5         3
5         3
5         3

it gets a little more complicated. You have to have at least one other dimension in the query to reference. It can be anything, but you have to be counting something in conjunction with the NUMBER dimension. So, the following would work, assuming there's another dimension in the query named [Duh]:

=Count([NUMBER];All)  ForAll([Duh])

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.