We have a pipe-delimited source file.
One of the fields is defined as integer.
We want to filter the file and only keep records where the 1st character of this integer field is 7 e.g 7, 777, 700000
I can't seem to get this to work in a Filter stage.
Can anyone give me some tips?
Thanks in advance.
Filtering on contents of Integer field
Moderators: chulett, rschirm, roy
No-one is laughing, we all were a noob at some point.
Your second syntax is correct, as long as the field is defined as a string:
You can then use StringToDecimal (off the top of my head) to properly convert the datatype for downstream consumption.
Your second syntax is correct, as long as the field is defined as a string:
Code: Select all
FieldName[1,1] = '7'
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
I'm not at a DS client to check this, but the indexing in transform starts at position 1 (for Server compatibility) while everywhere else strings start at position 0, so the correct form might be FieldName[0,1] = '7'
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Zero-based in Modify stage, one-based in Transformer stage.
This is because they wanted the Transformer stage to use BASIC-like expressions, which the compiler would translate into C constructs.
This is because they wanted the Transformer stage to use BASIC-like expressions, which the compiler would translate into C constructs.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.