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
#49843 - 10/23/14 05:29 PM Line Condition - Look a 2 different pieces of Data
Levi Offline
OL Newbie

Registered: 05/13/14
Posts: 26
Loc: Austin, Texas
Hello Once again!

I am having an issue trying to create a somewhat complicated rule (at least in my mind it's complicated).

Here is the scenario:

I have data coming in (duh!), and I want to look at the currently line of text. If there is any data in column 1 and in column 45, then return false.

Here is what I tried to use, based on a previous experience, but it doesn't seem to work:

Code:
=(@(&current.line,1,2))<'1' and (@(&current.line,75,80))<'1'

That told me that 'and' was an invalid operator
I also tried this:
Code:
and((@(&current.line,1,2))<'1',(@(&current.line,75,80))<'1')

That told me that 'and' was invalid'

How can I tell this line condition to look at these two different locations, and return true or false?

Many thanks for your help!
Levi

Top
#49844 - 10/23/14 05:37 PM Re: Line Condition - Look a 2 different pieces of Data [Re: Levi]
Jeff_K
Unregistered


Levi
Both versions are valid. What you are checking against is in question. By quoting, you are comparing to a string.

Therefore it begs the question if you are trying to compare the content of a numeric field to be greater than 1 or not.

Since you mention 'any data', I presume the fields are strings, and as such this should work:

=(@(&current.line,1,2))<'' and (@(&current.line,75,80))<''

Alternatively, look to make the individual conditions first. Then you can combine them after proving them working.

Top
#49862 - 10/24/14 10:38 AM Re: Line Condition - Look a 2 different pieces of Data [Re: Levi]
Levi Offline
OL Newbie

Registered: 05/13/14
Posts: 26
Loc: Austin, Texas
Jeff,
I entered the exact text in the line condition field (in the 'when advanced condition is true' field):
=(@(&current.line,1,2))<'' and (@(&current.line,75,80))<''

The response that shows up is:
PTK0051: Unknown operator or not a string. "and"

that is what I was getting before.
Any other thoughts?

Levi

Top
#49863 - 10/24/14 10:47 AM Re: Line Condition - Look a 2 different pieces of Data [Re: Levi]
Jeff_K
Unregistered


Looks like I lost parenthesis when posting. Try this:

=(((@(&current.line,1,2))<'') and ((@(&current.line,75,80))<''))

Top
#49864 - 10/24/14 11:10 AM Re: Line Condition - Look a 2 different pieces of Data [Re: Levi]
Levi Offline
OL Newbie

Registered: 05/13/14
Posts: 26
Loc: Austin, Texas
that was it!

Thank you so much, Jeff. You sir, are a Gentleman's Gentleman and a Scholar's Scholar!

Thanks again.
Levi

Top
#49865 - 10/24/14 11:45 AM Re: Line Condition - Look a 2 different pieces of Data [Re: Levi]
Ken Darby Offline
OL Guru

Registered: 07/31/01
Posts: 134
Loc: Indianapolis, Indiana, USA
Here is my contribution. Try this.

=(ne(@(&current.line,1,2),'')) and (ne(@(&current.line,75,80),''))

To parse it out in English, in both conditions, you are comparing a string read in from your data and if it is not an empty string the expression evaluates true and if both conditions evaluate true, the concatenated condition is true.

Top
#49866 - 10/24/14 11:55 AM Re: Line Condition - Look a 2 different pieces of Data [Re: Levi]
Levi Offline
OL Newbie

Registered: 05/13/14
Posts: 26
Loc: Austin, Texas
Actually,
I spoke too soon.

Looks like that didn't work.

Here is the issue:
In '&current.line,1,2' I want it to see if there is any TEXT present in those fields.
In '&current.line,75,80' I want it to see if there are any numbers in those fields.

What I am trying to get happen is: If there is no text in in 1,2 AND there are no Numbers in 75,80, then returns true.
If there is text in 1,2 or numbers in 75,80, then return false

So far,
This is what I have tried:
=(((@(&current.line,1,2))<>'') and ((@(&current.line,75,80))<>''))
=(((@(&current.line,1,2))<'1') and ((@(&current.line,75,80))<'1'))
=(((@(&current.line,1,2))>'1') and ((@(&current.line,75,80))>'1'))
=(((@(&current.line,1,2))<>'') and ((@(&current.line,75,80))>'0'))

thoughts?

Top
#49867 - 10/24/14 11:59 AM Re: Line Condition - Look a 2 different pieces of Data [Re: Levi]
Jeff_K
Unregistered


Back to my comments about field types - you need to specify numeric vs string field handling in the respective condition.
So you have these two conditions to concatenate with AND

String comparison
((@(&current.line,1,2))<>'')

Numeric comparison
(strtoint(@(&current.line,75,80))>0)

Try this:
=(((@(&current.line,1,2))<>'') AND (strtoint(@(&current.line,75,80))>0))


Edited by Jeff_K (10/24/14 12:00 PM)

Top
#49868 - 10/24/14 01:10 PM Re: Line Condition - Look a 2 different pieces of Data [Re: Levi]
Levi Offline
OL Newbie

Registered: 05/13/14
Posts: 26
Loc: Austin, Texas
After racking my brain, I realized I provided you with some slightly wrong information, which is why I am so confused (I'm very thankful for you help, and I'm sorry I am making this harder than it needs to be).

After writing it down, where I what I need, for the condition:

1)If no text in 1,2 and nothing in 75,80, then show.
2)If there is text in 1,2, then no show.
3)If there is anything in 75,80, then no show.

The text in 75,80 is a dollar value, like ' 50.00'.

What the data looks like is:
if 1)
Code:
'   1234567890123456789012345678901234567890123465789012345678901       '
^-show this
if 2)
Code:
'MB 1234567890123456789012346579801234657890123465798013246578901       '
^-don't show this
if 3)
Code:
'   1234567890123456798012346579801234657980132456789012346578901  50.00'
^-don't show this


Does that make sense? I had to put the text in code tags, so the form wouldnt strip the spaces

Thanks again for your help!
Levi


Edited by Levi (10/24/14 01:13 PM)

Top
#49871 - 10/24/14 04:16 PM Re: Line Condition - Look a 2 different pieces of Data [Re: Levi]
Jeff_K
Unregistered


Levi,
Using your strings above, the field placement is slightly off, but I got it sorted out now. you may need to tweak positions of the second field.

no text in 1,2:
=((@(&current.line,1,2))=' ') [two spaces]

Something other than spaces in 75-80
=((@(&current.line,75,80))=' ') [six spaces]

I went with spaces as it assumes anything else is playing into the false condition. So only 2+6 spaces = true.
So concatenated together (with extras spaces for clarity sake):
=((@(&current.line,1,2))=' ') AND ((@(&current.line,75,80))=' ') )

Top
Page 1 of 2 1 2 >