how i can do it : PostalCode : the first prefix of the PostalCode. For example if it 49278 make it 4

inas_ayinas_ay Member Posts: 1 Newbie
edited November 2018 in Help
i have adata set with postalCode attr , please help me to make this in  generate attributes


  • Options
    M_MartinM_Martin RapidMiner Certified Analyst, Member Posts: 125 Unicorn
    Hi inas_ay: Take a look at the Cut function - it is similar to the Excel MID function.  You can use that with the Generate Attributes operator.  If I understood your question properly, that should do the trick.  If you still have any questions, write back.  Best Wishes, Michael Martin 
  • Options
    Telcontar120Telcontar120 Moderator, RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 1,635 Unicorn
    The "prefix" function inside the Generate Attributes operator will also more directly do what you want.  The arguments you enter are the string variable to prefix and the number of positions you want to get (starting in the first position).  So for example "prefix(PostalCode,1)" will return the first digit of the postal code.

    Brian T.
    Lindon Ventures 
    Data Science Consulting from Certified RapidMiner Experts
Sign In or Register to comment.