IMPORTANT ANNOUNCEMENT

These forums were permanently set to read-only mode on July 20, 2022. From that day onwards, no new posting or comment is allowed on the site, but the historical content remains intact and searchable.

A new location for posting questions about PlanetPress Suite is now available:

OL Learn - PlanetPress Classic (opens in new tab)

Page 1 of 2 1 2 >
Topic Options
#38116 - 12/22/11 03:28 PM Text based Condition on database emulation
dweg Offline
OL Expert

Registered: 11/05/08
Posts: 162
Loc: Denver
I'm using database emulation and trying to figure out a way to use text based conditions when there are like strings in the different conditions.

For example I want to create two text based conditions, using "region as the Operator". I have two different strings in the dbase field that I want to trigger the two different conditions with. One is "Loan" and the other is "HomeLoan".

Problem is the string "Loan" makes each condition true because "Loan" is in both records, but I don't know how to make the condition look at positions within that field not a region as you can do with ASCII data sets. I know I can invert conditions but I don't want to do that because I have quite a few conditions I need to add that are similar to the above example and it would end up a mess.

Any ideas would be appreciated.

Top
#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: ]
dweg Offline
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: ]
dweg Offline
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: ]
dweg Offline
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
Page 1 of 2 1 2 >