01-06-2016 06:34 AM
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
01-06-2016 07:27 AM
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
01-06-2016 07:37 AM
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
01-06-2016 08:08 AM
Thank you very much Stan, I appreciate your reply.
I'll have a crack at that and see how I get on.
M