count of units with condtition

I need the count of units where all the documents should be site(Please see the attachment).

Below is the code which iam using,which counts units if any of the document is having code is site.

=Count(If(([Code]=“SITE”);([Unit])))

Please guide me in giving the exact code which gives the count correctly.

Thanks in advance.

Srinivas
units.xls (19.0 KB)


srinivas_bo :india: (BOB member since 2007-05-03)

Hi,
Create this variable and use for the Unit column.
Unit_v=IF([Code]=“SITE”;Count([Unit]);[Unit])
Try this code if it helps you.

Below are few examples:
Count(“Test”) returns 1
Count([City]; DISTINCT) returns 5 if there are 5 different cities in a list of cities, even if there are more than 5 rows in the list due to duplication.
Count([City]; ALL) returns 10 if there are 10 cities in a list of cities, even though some are duplicated.
Count ([City]; INCLUDEEMPTY) returns 6 if there are 5 cities and one blank row in a list of cities.


GNK_BO (BOB member since 2007-07-17)

Hi

The formula is not working.it throws me error.i tryied in different ways with foreach,forall but iam getting the all the units count.
i need count where all the documents should be site. :hb:


srinivas_bo :india: (BOB member since 2007-05-03)

I don’t have WEBI installed atm (long story) but there is another option other than Count…

Try something like this in a total line:
=sum(if([Code]=“SITE”;1;0))

That is an old way of doing an CountIF type function when you don’t have a count available…

If that doesn’t work, please provide whatever error message your getting, maybe the problem is unrelated to your formula…


JPetlev (BOB member since 2006-11-01)

I tryied the above code also .it’s not working as required.

I want the unique count of units where code of all the documents shoul be equl to site.


srinivas_bo :india: (BOB member since 2007-05-03)

Also for each country if the unit no is same that should not be counted as unque,only unique shoul be considered with in the country.


srinivas_bo :india: (BOB member since 2007-05-03)

I think you might need to attach a screenshot of your actual document so we can see exactly what the problem is… the only reason the formulas above wouldn’t work that I can think of, is if you have sections or other breaks which would reset the counters.


JPetlev (BOB member since 2006-11-01)