I have the following flow...
Flat File -----------> Filter -------> remaining stages.
In flat file, I have a field product_id. I want to process only those records where the product_id is not null or blank.
I used the following statment in the where clause of a filter stage...
Trim(product_id)<>''
But job geting aborted compaling
"Expected comparison, 'between', or 'like' operator, got: "("
Parse error: Expected boolean operator (and, or) got: "product_id"."
Please help how can I use filter stage to do my job.
Filter Stage - Custom function
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 238
- Joined: Fri Jul 25, 2008 8:55 am
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Move the trim to an upstream Transformer or Modify stage.
Of course, if you're going to use a Transformer stage, you can eliminate the Filter stage and use constraint expressions in the Transformer stage instead.
Of course, if you're going to use a Transformer stage, you can eliminate the Filter stage and use constraint expressions in the Transformer stage instead.
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.
-
- Premium Member
- Posts: 238
- Joined: Fri Jul 25, 2008 8:55 am
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
If you are so particular to use within filter then you can include multiple condition for each length possibility.
For example, if the field productId is of 2 char length, you can write
You can try to pad the field with spaces from source and use a single full length blank check in filter.
For example, if the field productId is of 2 char length, you can write
Code: Select all
If productId = '' Or productId = ' ' Or productId = ' '
False Link
Otherwise
True Link
-
- Participant
- Posts: 5
- Joined: Sun Jan 15, 2006 11:45 pm
- Contact:
Mukesh
Should use transform stage in between flat file and filter stage and use below syntax.
Product_ID : If IsNull(product_id) then setNull() else trim(product_id)
![Laughing :lol:](./images/smilies/icon_lol.gif)
Product_ID : If IsNull(product_id) then setNull() else trim(product_id)
M.K.Madhav