how to add fixed amount of minutes, to hours.

danielsoydanielsoy Member Posts: 20 Contributor II
edited November 2018 in Help

Hello.

 

I need to add a fixed amount of minutes, to an attribute columm, that contains hours.

So if my hour attribute contains 12:00 for instance, it should contain 12:15 after the operation, in case I want to add 15 minutes.

 

my proccess.

 

Thanks a lot.

Tagged:

Best Answer

  • JEdwardJEdward RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 578 Unicorn
    Solution Accepted

    There's an operator called 'Adjust Date' which is very simple to configure.

    Select the attribute you want to adjust, select the unit you want to add(or subtract) in this case minutes, next type in the adjustment value. 

     

    For more complex calculations or to convert your hour column if it is stored as nominal then the Generate Attribute operator is your friend.  Here you can type something like:

    date_str_custom(
    date_add(
    date_parse_custom(myTimeAtt,"HH:mm"),15,DATE_UNIT_MINUTE
    )
    ,"HH:mm")

    This will convert your nominal value into a date add 15 minutes and then convert it back into a nominal value. 

Answers

  • danielsoydanielsoy Member Posts: 20 Contributor II

    I ve got ¨PROBLEM OCCURRED¨ with Adjust Date operator related with the value type of my HOUR att.

     

    But I could make it with generate att n the proposed expression:

    solved

     

    Thanks JEdward for your help.

     

    Cheers!

Sign In or Register to comment.