#38117 - 12/22/11 03:34 PM
Re: Text based Condition on database emulation
[Re: dweg]
|
Eric Lachance
Unregistered
|
** EDIT: Oh wait, darn, I misunderstood the question... Recalculating!!! ***
Edited by Eric Lachance (12/22/11 03:36 PM) Edit Reason: big oops
|
Top
|
|
|
|
#38118 - 12/22/11 03:44 PM
Re: Text based Condition on database emulation
[Re: ]
|
Eric Lachance
Unregistered
|
Ok so not only had I misunderstood the question, I answered in regards to Workflow, not Design...
Instead of using the Region operator, I would rather change the Condition Type to "Advanced" and type in a PlanetPress Talk comparison, for example:
=pos('Laredo', Field('City',1)) > 0
or in your case,
=pos(' Loan ', Field('MyField',1)) > 0
Now, this would work if there is a space before or after the word Loan... Or you could have just the space before if it's the end of the sentence, etc...
Sorry about the multiple edits, I'm out of it today I think, should have left this to those with more brain power :|
Edited by Eric Lachance (12/22/11 03:47 PM) Edit Reason: wrong condition
|
Top
|
|
|
|
#38119 - 12/22/11 04:08 PM
Re: Text based Condition on database emulation
[Re: ]
|
Pages
Unregistered
|
Hi,
conditioning on >1 would allow you to have two distinctive results because the >0 will get both HomeLoan and Loan as the result whereas >1 would be HomeLoan and =1 would be for Loan thus giving you both conditions.
Regards,
|
Top
|
|
|
|
#38120 - 12/22/11 04:33 PM
Re: Text based Condition on database emulation
[Re: ]
|
OL Expert
Registered: 11/05/08
Posts: 162
Loc: Denver
|
Very nice Eric, but I need to throw in a curve.
Two strings: Checking Account Hillbilly Checking Account
These two both trigger on the condition: =pos('Checking Account', Field('MyField',1)) > 0
|
Top
|
|
|
|
#38121 - 12/22/11 04:41 PM
Re: Text based Condition on database emulation
[Re: dweg]
|
Pages
Unregistered
|
Hi,
same logic as above could be applied here whereas :
=pos('Checking Account', Field('MyField',1))>1 (means HillBilly was found)
=pos('Checking Account', Field('MyField',1))=1 (means HillBilly was NOT found)
Hope this helps.
Regards,
|
Top
|
|
|
|
#38122 - 12/22/11 04:51 PM
Re: Text based Condition on database emulation
[Re: ]
|
OL Expert
Registered: 11/05/08
Posts: 162
Loc: Denver
|
Pages, the = 1 did work perfectly on all the conditions. Help me understand... what is the difference between the > 1, > 0, and = 1
|
Top
|
|
|
|
#38123 - 12/22/11 05:00 PM
Re: Text based Condition on database emulation
[Re: dweg]
|
Pages
Unregistered
|
Dweg,
It's fairly simple, the pos function checks for a position of a given string.
If pos = 1 then the string was at the first position If pos > 1 then it was not at the first position but was there in the searched field If pos = 0 then the string was not found at all.
Hope this clarifies.
Kind Regards,
|
Top
|
|
|
|
#38124 - 12/22/11 05:25 PM
Re: Text based Condition on database emulation
[Re: ]
|
OL Expert
Registered: 11/05/08
Posts: 162
Loc: Denver
|
Pages, Thanks for the simple explanation.
So there's really nothing that would take into account any spaces (null values?) after the string? Like if it was a 30 char length field and would recognize the difference between...
Checking Account One or Checking Account
with the balance of the unused 30 characters in the mix.
|
Top
|
|
|
|
#38128 - 12/27/11 09:27 AM
Re: Text based Condition on database emulation
[Re: dweg]
|
Pages
Unregistered
|
Dweg, you have to figure the condition of the string before applying the function to find the bit of string you are looking for.
In other words, you need to condition on the difference in the strings so that it can find the one you are looking for regardless of the amount of whitespaces in it.
Between Checking Account One and Checking Account, there is the "One" that differs so you could check for whats at the end with the function right, for example. The lenght function could also give you a clue as to wheather or not you are looking at the right string since it will not take the whitespaces into account. If your field is a varchar(30) but only uses 17chars for example, PlanetPress will make the string 17chars long.
Hope this helps.
|
Top
|
|
|
|
|
|