"Using multiple id to update database"

RayJhongRayJhong RapidMiner Certified Analyst, MemberPosts:11Contributor II
edited June 2019 inHelp

When using"Update Database"operator, there is a description for "attribute filter type" says:

subset: This option allows the selection of multiple id attributes throught a list ...

Screen Shot 2018-02-05 at 2.43.36 PM.png

My question is how to set multiple id attributes using"set role"operator, i have two attributes(machine_id & time_stamp) to set as id in order to update my orginal DB table, however,"set role"operator always keep lastest one attribute as id not both. Is there any way to set multiple attribute, or i misunderstand the description above?

by the way, i've tried using user define attribute set machine_id as id_1, time_stamp as id_2, but didn't work on"Update Database"operator, it will be recognized as different row.

Here is the operator.







<运营商激活= " true " class = "过程”兼容ibility="8.0.001" expanded="true" name="Process">






<参数键= " target_role " value = " id " / >




















Appreciated,

Ray Jhong

Tagged:

Answers

  • MartinLiebigMartinLiebig Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, University ProfessorPosts:3,404RM Data Scientist

    Hi@RayJhong,

    roles are unique. it is only possible to set each role once. However, if you choose more than one attribute in the selector of Update Database, it will take them for the update in the DB. This is independent of roles (except for the include special).

    Best,

    Martin

    - Sr. Director Data Solutions, Altair RapidMiner -
    Dortmund, Germany
    sgenzer
  • RayJhongRayJhong RapidMiner Certified Analyst, MemberPosts:11Contributor II

    Hi@mschmitz

    Thank you for quick reply, i've tried choosing both attribute as selector but got wrong result as below:Screen Shot 2018-02-05 at 3.34.24 PM.png

    Result seems like it didn't treat Machine_ID & Time_Stamp as keys to update Failure, instead, it became a new row.

    Screen Shot 2018-02-05 at 3.38.08 PM.png

  • MartinLiebigMartinLiebig Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, University ProfessorPosts:3,404RM Data Scientist

    Hi,

    have you tried "Include Special Attributes"? Otherwise, specials of your selection are ignored. Not very intuitive in this operator, but this is how it works.

    Best,

    Martin

    - Sr. Director Data Solutions, Altair RapidMiner -
    Dortmund, Germany
    sgenzer
  • RayJhongRayJhong RapidMiner Certified Analyst, MemberPosts:11Contributor II

    Hi@mschmitz

    The same result. and i also tried remove"set role"operator to prevent any special attribute to be excluded but nothing changes. Is is possible for you to reproduce my situation? here is the process:







    <运营商激活= " true " class = "过程”兼容ibility="8.0.001" expanded="true" name="Process">



















    And datasource is inSamples/Templates/Predictive Maintenance/reference data一个time_stamp capturing current date time.

    Sincerely,

    Ray Jhong

Sign InorRegisterto comment.