Dear CLIPS users,

    Please take a look at this code:

(deffacts get-all-facts
(BeastTest        2669     6901556 313            162.36         160)
(BeastTest        2669     7373679 101            300.00         175)
(BeastTest        2669     7373679 102            300.00         175)
(BeastTest        2669     7373679 103            300.00         175)
(BeastTest        2669     7373679 104            300.00         175)
(BeastTest        2669     7373679 105            300.00         175)
(BeastTest        2669     7373679 106            152.00         175)
(BeastTest        2669     7373728 192            150.00         175)
(BeastTest        2669     7373728 193            357.00         175)
(BeastTest        2669     7443890 4025           324.00         176)
(BeastTest        2270     1112200 123            234.44          176)
(BeastTest        2270     1112200  124            234.44          176)
(BeastTest        2270     1112200  125            123.33          177)
)

(defrule get-match-facts
    ?f1 <- (BeastTest ?beast_id ?account_id ?chk_one ?amt_one ?date)
    ?f2 <- (BeastTest ?beast_id ?account_id ?chk_two ?amt_two ?date)
    (test (< (fact-index ?f1) (fact-index ?f2)))
=>
    (printout t "Need to count these " ?beast_id" "?account_id crlf)
    (assert (BeastTest ?beast_id ?account_id ?chk_one ?amt_one ?date))
    (retract ?f1)
)

How can I count the second column to see how many of rows show up
with first column, and last column have to be match

Need to count these 2669 7373728 -------> total 2 rows
Need to count these 2669 7373679 -------> total  6 rows
Need to count these 2270 1112200 -------> total 2 rows

Regards,
Andy



---------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the
list (use your own address!) List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------

Reply via email to