Click here to Skip to main content
15,923,142 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more: (untagged)
Task and category defined in my system
+ category defined: cat1, cat2, cat3
+ existing tasks:
- task1 (categorized: cat1, cat2, cat3)
- task2 (categorized: cat1, cat2)
- task3 (categorized: cat1, cat3)
- task4 (categorized: cat1)

The required answer:
Required filtering:
task categorization is a set containing cat1 AND cat2
Expected answer:
-task1
-task2

ToDoList real answers:
Case1
+ Filtering fields status:
- CATEGORY: checked cat1 AND cat2
- OPTIONS: none
+ Answer:
- task2

Case2
+ Filtering fields status:
- CATEGORY: checked cat1 and cat2
- OPTIONS: Any category can match
+ Answer:
- task1
- task2
- task3
- task4

Is it possible to obtain the required answer?
Posted
Updated 2-Mar-11 2:43am
v2
Comments
Henry Minute 2-Mar-11 8:47am    
What sort of system?

A database? If so which one.
Which language? Do you have a preference?

Your tag of 'questions' is useless, it gives no indication as to the content of your question.

Also bolding everything does not make your question any clearer, it just makes it more difficult to read. It is the equivalent of of shouting.
Sandeep Mewara 2-Mar-11 9:03am    
Just looks like some homework question that too a little incomplete! :doh:

1 solution

In php :

$task1["cat1"] = 1
$task1["cat2"] = 1
$task1["cat3"] = 1

$task2["cat1"] = 1
$task2["cat2"] = 1

$task3["cat1"] = 1
$task3["cat3"] = 1

$task4["cat1"] = 1

// Case 1 :
if (isset($task1["cat1"]) && isset($task1["cat2"] && !isset($task1["cat3"])
    echo "task1 does match !"

if (isset($task2["cat1"]) && isset($task2["cat2"] && !isset($task2["cat3"])
    echo "task2 does match !";





and so on ...

 
Share this answer
 
v6

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900