Hitachi Vantara Pentaho Community Forums
Results 1 to 8 of 8

Thread: Filter and In line

  1. #1
    Join Date
    Sep 2011
    Posts
    171

    Default Filter and In line

    Hello Everyone,

    I noticed that "Filter rows" component is very strict. For example, I would like only rows containg work "snow" to through and in filter I choose option "in line" and then in value field I type " snow " with blank space before and after. In this case filter is not going to work properly. Am I correct?

    I wonder if there is filter with option "substring", kind of opposite of option "contains"?

    Regards,
    Alex

  2. #2
    Join Date
    Jun 2007
    Posts
    260

    Default

    "snow" is not equal to "snow ". However, depending on where you are getting the string from, you can apply trim to the string, or use a calculation or javascript to trim the space manually.

  3. #3
    Join Date
    Apr 2008
    Posts
    4,696

    Default

    Are you looking for:
    <Field> CONTAINS "snow" to be filtered so that it passes, or fails?

    You could do:
    NOT (<Field> CONTAINS "snow") -- which would fail any value like "snowing" as well...

  4. #4
    Join Date
    Nov 2008
    Posts
    271

    Default

    Hi Alex,
    do you mean "in list"?

    Anyway for matching a word, you should use CONTAINS and then type your word. For more challenging matches, you can use REGEXP (regular expressions).

    HTH
    Andrea Torre
    twitter: @andtorg

    join the community on ##pentaho - a freenode irc channel

  5. #5
    Join Date
    Sep 2011
    Posts
    171

    Default

    Yeap, I guess I have use some other tool (javascript)

    I want row with snow field to go through, so I guess ideal would be <field> sub-string <value>

    Thank you for the replies!

  6. #6
    Join Date
    Sep 2011
    Posts
    171

    Default

    Andrea, I just noticed your post! Yeap, I meant "in list"

    How would I use REGEXP so that "snow" would go through as a substring of " snow "?

    Thank you,
    Alex

  7. #7
    Join Date
    Nov 2008
    Posts
    271

    Default

    Alex,
    I'm afraid I cannot understand your requirement.

    You need to isolate the word snow in a string and then assign it to a new field? In this case you need the Regex Evaluation step.

    OR

    You want the rows containing the word "snow" pass to next step? In this case you can stick to filter rows with CONTAINS option.

    I mentioned regexp (in filter rows) just as a more powerful tool when it comes to match complex substrings.
    Last edited by Ato; 09-23-2011 at 04:55 PM.
    Andrea Torre
    twitter: @andtorg

    join the community on ##pentaho - a freenode irc channel

  8. #8
    Join Date
    Sep 2011
    Posts
    171

    Default

    Sorry guys, it is the end of the day on Friday

    I need to think more about the statement of my problem.
    Last edited by august_month; 09-23-2011 at 05:50 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.