swf Posted January 24, 2005 Share Posted January 24, 2005 I am trying to make a calculation to detect the word Monthly anywhere in a text string. current calculation will only detect it by itself not mixed in with other words. If(memo="Monthly";1,0) Thanks Link to comment Share on other sites More sharing options...
QuinTech Posted January 24, 2005 Share Posted January 24, 2005 Hi, swf. Try instead: PatternCount ( memo , "Monthly" ) This will tell you the total number of times that word appears in that field. HTH, Jerry Link to comment Share on other sites More sharing options...
swf Posted January 24, 2005 Author Share Posted January 24, 2005 If (PatternCount(memo,"Monthly")>0;1,0) Does that look right. If it finds it more than 0 times it will return a logical 1. I will try. Thanks Link to comment Share on other sites More sharing options...
QuinTech Posted January 24, 2005 Share Posted January 24, 2005 True; but FM also recognizes any number greater than zero as "true." Thus, if this calc finds "monthly" twice, the expression i wrote still evaulates to "true." It's a very minor point, but people on this forum (like -Queue- and comment) will jump all over you if they find extraneous stuff in your calcs. J Link to comment Share on other sites More sharing options...
comment Posted January 24, 2005 Share Posted January 24, 2005 I don't recall jumping all over anyone, but hey, I like having a reputation! Link to comment Share on other sites More sharing options...
swf Posted January 24, 2005 Author Share Posted January 24, 2005 Thank you, the last part I had never heard of. I have a follow up question. I have a field that is lookup field. I want it to look up one place if Monthly=1 and another place if Monthly=0. Example if it is a monthly meeting (monthly=1) then it will lookup the employee who is permanently assigned to the account. If it is a regular meeting (monthly-0) it will lookup the employee based on a schedule of days and which employee is on duty. Link to comment Share on other sites More sharing options...
-Queue- Posted January 24, 2005 Share Posted January 24, 2005 For shame, Jerry. I resemble that remark! If you need an exact boolean, not not PatternCount( ) (or not not Position( ), which is faster when testing large text fields) converts any result > 1 to 1. Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 6638 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now