Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
Can any one tell how to compare two strings and provide the count based on matching?
For Example:
String are:
South Africa
South Afri
Count is 10(including space)
Hi,
Please find attached file for solution, used macro to solve this.
Regards,
Jagan.
Hi,
If('South Africa' = 'South Afri', 'Match', 'Not Match')
Len() is used to find the length of the string.
Regards,
Jagan.
This?
If(left('South Africa', Len('South Afri')) = 'South Afri', Len('South Afri' )) // here you can replace the strings accordingly
If not this, plesae expain a bit more.
Thanks Jehan,
But i want to compare two column of data which are having string data and give the count value for each row of data
My input are like as follows:
String1 | String2 |
Samsung | Samsun |
China | Chinna |
I want to get the count based on number of characters are matching.
like as follows:
String1 | String2 | Count |
Samsung | Samsun | 6 |
China | Chinna | 4 |
That means you need to some function which would give the first mismatch chracter position. QV doest not have a function for that. I guess you can try creating a vb function and call that in the script.
If the length of the fields are relatively small, you you could make embedded if formulas comparing the first character in first level if, two characters in second level if .. undtil you reach the maximum string size.
Not pretty - but it might be a solution.
Hi,
Please find attached file for solution, used macro to solve this.
Regards,
Jagan.
Hello,
I have created a function in VB and implemented that during load. Happy to try it and achieving.
Hope it helps.
PFA
use this expression in your script
If(left(String1, Len(String2)) = String2, Len(String2 )) As Count