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

inas_ay
inas_ay New Altair Community Member
edited November 5 in Community Q&A
i have adata set with postalCode attr , please help me to make this in  generate attributes
Tagged:

Answers

  • M_Martin
    M_Martin New Altair Community Member
    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 
  • Telcontar120
    Telcontar120 New Altair Community Member
    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.