Tableau split string and take from x token until the end of tokens

孤街浪徒 提交于 2020-01-03 03:27:35

问题


I have a field of strings and want to take all the "Elements from position x until the end.

For example there is a "Field Name" column with the following values:

  • /one/two
  • /three/three/four
  • /five/six

As result I would like to have:

  • two
  • three/four
  • six

I tried with SPLIT([Field Name], '/', 2) but then the "four" is missing. Is there a way to talk from token 2 until the end of tokens?


回答1:


This should work:

RIGHT([Field Name],LEN([Field Name]) - FINDNTH([Field Name],"/",2))

This is returning the right part of the string [Field Name] and specifying to keep the last n characters, where n = length of the original string minus the location of the second "/".



来源:https://stackoverflow.com/questions/49922554/tableau-split-string-and-take-from-x-token-until-the-end-of-tokens

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!