Community
Showing results for 
Search instead for 
Do you mean 
Reply

Manipulating query results

New Member
Posts: 2
Country: United_Kingdom

Manipulating query results

ACT! Version 14 on Windows 7, shared database

 

Hello,

 

I have set up a group to run a lengthy search criteria. Currently, each criterion has an 'OR' operator but I want to be able to isolate the group of contacts where three or more of these criteria returns true and drop all the others, is such a thing possible?

 

Many thanks in advance.

 

M

Silver Super Contributor
Posts: 2,328
Country: USA

Re: Manipulating query results

You might be able to do it by breaking down all the possible combinations.  Depending on the number of criterion that could get quite lengthy but it would probably work for a smaller number of criteria.  Something like this with criteria A, B, C and D.

 

If ((A = true) and (B = true) and (C = true)) OR ((A = true) and (B = true) and (D = true)) OR ...

 

for

 

A, B, C

A, B, D

A, C, D

B, C, D

 

etc,

 

The numbers can get pretty large pretty quickly though.  For example the number of ways you can take 8 variables 3 at a time is 56.

 

Good luck!

 

Stan 


If you would like to get more out of ACT! you can find an ACT! Certified Consultant near you by going to:www.act.com/acc.
-------------------------------------------------------------------------------------
Stan Smith
ACT! Certified Consultant
ADS Programming Services, Inc.
(205) 222-1661
www.adsprogramming.com
www.actwebhosting.com
Click Here to Purchase Act!
Silver Super Contributor
Posts: 2,328
Country: USA

Re: Manipulating query results

In case you want to figure out the number of possible combinations yourself the equation is:  nPr = n! / r! * (n - r)! 

This is the equation for combinations since you don't care about the order of the parameters.

 

So for 8 items taken 3 at a time it is:  8! / 3! * (8 - 3)!

8! / 3! * (5)!

=  8*7*6*5*4*3*2*1 / (3*2*1) * (5*4*3*2*1)

=  8*7*6 / 3*2*1

= 8*7*6 / 6

= 8*7

= 56

 

Stan


If you would like to get more out of ACT! you can find an ACT! Certified Consultant near you by going to:www.act.com/acc.
-------------------------------------------------------------------------------------
Stan Smith
ACT! Certified Consultant
ADS Programming Services, Inc.
(205) 222-1661
www.adsprogramming.com
www.actwebhosting.com
Click Here to Purchase Act!
New Member
Posts: 2
Country: United_Kingdom

Re: Manipulating query results

Thank you very much Stan, I appreciate your reply.

 

I'll have a crack at that and see how I get on.

 

M