Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: Question regarding Filter step

  1. #1

    Default Question regarding Filter step

    Hi,

    It might be a stupid question but I'm gonna ask it anyway . In a Filter step I used the following condition a_date <= b_date. And it worked ok ... the dates were something like number of days since 1960 and of type String. But In one case I kept getting the row filtered to the dummy destination. The problem was that a_date was something like 9700 and b_date=17200. And a_date <=b_date always returned false. Until I added a "0" in front of a_date and everything worked ok. What was the problem with the original test, without the leading 0 for a_date ???
    Thx for the answer.

    Regards,
    Gigi

  2. #2
    Join Date
    May 2006
    Posts
    4,882

    Default

    9700 and 17200 ...

    compare them as strings and 17200 comes before 9700 ... since 1 comes before 9
    compare them as integers and 9700 comes before 17200

    Is this what happened?

    Regards,
    Sven

  3. #3

    Default

    damn it ... i was right about the question being stupid ... I thought maybe there was an easy way to get around this problem ... Thx

  4. #4
    Join Date
    May 2006
    Posts
    4,882

    Default

    well compare as int or date?

    Regards,
    Sven

  5. #5

    Default

    i didn't convert the strings to integer or date ... i just added extra 0s till both strings had the same length. I know it's not the best solution, but in this way i modified only the javascript steps and not all the other steps. Thx for the answer

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.