5 Replies Latest reply on Jun 11, 2010 3:22 AM by comment_1

# ValueCount - combine more than 1 ValueCount calc?

### Title

ValueCount - combine more than 1 ValueCount calc?

### Post

Hi

Is it possible to create a calc field that combines more than one ValueCount calc?

For example:

If I want to know how many Granny Smith apples are green, should I aim for something like this (incidentally this doesn't work, but it just returns a number 1 in the calc field)?

ValueCount ( FilterValues ( List (Apples); "Granny Smith") ) and ValueCount ( FilterValues ( List (Colour); "Green") )

and, if f I want to know how many Granny Smith apples are purple:

ValueCount ( FilterValues ( List (Apples); "Granny Smith") ) and ValueCount ( FilterValues ( List (Colour); "Purple") )

Thanks in advance for any assistance that can be provided

Aikiko

• ###### 1. Re: ValueCount - combine more than 1 ValueCount calc?

Well,

ValueCount ( FilterValues ( List (Apples); "Granny Smith") ) + ValueCount ( FilterValues ( List (Colour); "Green") )

would tell you how many apples are Granny Smith OR green (cumulative). You cannot tell how many are Granny Smith AND green by looking at two independent lists.

• ###### 2. Re: ValueCount - combine more than 1 ValueCount calc?
Hmmm....that's a shame. Thanks for the clarification. Aikiko
• ###### 3. Re: ValueCount - combine more than 1 ValueCount calc?

There are, of course, other methods. It depends on what exactly you're trying to achieve. For example, you could add a calculation field in the Apples table and count/sum the results. But the best way, IMHO, is to find the matching records.

BTW, the syntax List (Apples) would work only with a repeating field - I hope that's not the case here.

• ###### 4. Re: ValueCount - combine more than 1 ValueCount calc?

Yes, List(apples) is actually List(Fruit::apples) or a variation thereof.

I would like to create a report that automatically updates itself. The report would have ~250 (50 colours x 5 types of apples) searches.

e.g. how many granny smith apples (1 of 5 apple types) are green (1 of 50 colours)?

how many golden delicious apples  are yellow?

And so forth.

Perhaps would another method be to do a calc that includes a 'find' function e.g. find Apples:Granny Smith AND find 'colours:green'?

Thoughts?

• ###### 5. Re: ValueCount - combine more than 1 ValueCount calc?

I'm not sure I understand. It seems to me that a report (produced from the Apples table) summarized by type and color would provide what you describe, in this format:

Granny Smith

• Green: 5

* Yellow: 3

Golden Delicious

• Green: 2

* Yellow: 8

...

Of course, by performing a find you can control which types and colors (or combinations thereof) will appear in the report.