Skip to main content
Jamil Zaidan 님이 #Tableau Desktop & Web Authoring에 질문했습니다

We are being asked to split one column of data into two separte columns. The issue I am having is column can either be a 5 character string ("12345") or a 7 character string ("1234567"). I want to put the data into two separate columns as Column A ("12345") and Column B ("67" or null if there is no characters after the 5 character string.

 

Thank you for your help

답변 2개
  1. 2023년 3월 23일 오후 4:44

    Figured it out.

     

    For the first column, use the following calculated field

    LEFT([string],5)

     

    For the second column, use the following calculated field

    IF LEN([string])= 7 THEN RIGHT([string], 2)

    END

    Hope this helps anyone on the same journey

0/9000