#49843 - 10/23/14 05:29 PM
Line Condition - Look a 2 different pieces of Data
|
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: =(@(¤t.line,1,2))<'1' and (@(¤t.line,75,80))<'1' That told me that 'and' was an invalid operator I also tried this: and((@(¤t.line,1,2))<'1',(@(¤t.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:
=(@(¤t.line,1,2))<'' and (@(¤t.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]
|
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): =(@(¤t.line,1,2))<'' and (@(¤t.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:
=(((@(¤t.line,1,2))<'') and ((@(¤t.line,75,80))<''))
|
Top
|
|
|
|
#49864 - 10/24/14 11:10 AM
Re: Line Condition - Look a 2 different pieces of Data
[Re: Levi]
|
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]
|
OL Guru
Registered: 07/31/01
Posts: 134
Loc: Indianapolis, Indiana, USA
|
Here is my contribution. Try this.
=(ne(@(¤t.line,1,2),'')) and (ne(@(¤t.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]
|
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 '¤t.line,1,2' I want it to see if there is any TEXT present in those fields. In '¤t.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: =(((@(¤t.line,1,2))<>'') and ((@(¤t.line,75,80))<>'')) =(((@(¤t.line,1,2))<'1') and ((@(¤t.line,75,80))<'1')) =(((@(¤t.line,1,2))>'1') and ((@(¤t.line,75,80))>'1')) =(((@(¤t.line,1,2))<>'') and ((@(¤t.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 ((@(¤t.line,1,2))<>'')
Numeric comparison (strtoint(@(¤t.line,75,80))>0)
Try this: =(((@(¤t.line,1,2))<>'') AND (strtoint(@(¤t.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]
|
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) ' 1234567890123456789012345678901234567890123465789012345678901 ' ^-show this if 2) 'MB 1234567890123456789012346579801234657890123465798013246578901 ' ^-don't show this if 3) ' 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: =((@(¤t.line,1,2))=' ') [two spaces]
Something other than spaces in 75-80 =((@(¤t.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): =((@(¤t.line,1,2))=' ') AND ((@(¤t.line,75,80))=' ') )
|
Top
|
|
|
|
|
|