dbTalk Databases Forums  

Count differences beetwen 2 fileds?

comp.databases.filemaker comp.databases.filemaker


Discuss Count differences beetwen 2 fileds? in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Boubahha
 
Posts: n/a

Default Count differences beetwen 2 fileds? - 01-13-2006 , 11:38 AM






Hello!

Is there a way to count differences beetwen 2 fileds with FMPA 8v2 ?

Exemple :

test 1 :

FIELD_1 = "TABLE"
FILED_2 = "TOBLE"
RESULT = 1

(A and O)

test 2 :

FIELD_1 = "BLUE COW"
FILED_2 = "BLOW CUW"
RESULT = 3

(U and O, E and W, O and U)

Thaks for your help!



Reply With Quote
  #2  
Old   
42
 
Posts: n/a

Default Re: Count differences beetwen 2 fileds? - 01-13-2006 , 03:36 PM






In article <43c7e591$0$31961$636a55ce (AT) news (DOT) free.fr>, fsdf (AT) fdsfdfds (DOT) com
says...
Quote:
Hello!

Is there a way to count differences beetwen 2 fileds with FMPA 8v2 ?

Exemple :

test 1 :

FIELD_1 = "TABLE"
FILED_2 = "TOBLE"
RESULT = 1

(A and O)

test 2 :

FIELD_1 = "BLUE COW"
FILED_2 = "BLOW CUW"
RESULT = 3

(U and O, E and W, O and U)

Thaks for your help!
custom function (recursive)


myDiffFunc(u,v)

returns:

case(
length(u) = 0, length(v),
length(v) = 0, length(u),

(left(u,1) = left(v,1)) +
myDiffFunc(right(u,length(u)-1, right(v,length(v)-1)
}

I haven't tested it but it should work. You'll need to tweak it a bit if
you want it to count a and A as "different" -- simply replace the
equality test with the Exact() function.

-cheers,
Dave






Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.