The FIND & FINDNTH Functions in Tableau
top of page

The FIND & FINDNTH Functions in Tableau

Writer's picture: Bernard KilonzoBernard Kilonzo
Tableau find and findnth functions

Introduction

The FIND function

Syntax

FIND (String, Sub-string, Start)

This function returns the index position of a ‘sub-string’ in a ‘string’, or 0 (zero) if the ‘sub-string’ isn’t found. If the optional argument ‘Start’ is added, the function ignores any instances of ‘sub-string’ that appear before the index position ‘Start’. Note, the first character in a string is position 1.

For example.

FIND (“Dashboards”, “a”) = 2

FIND (“Dashboards”, ”a” ,5) = 7

FIND (“Dashboards”, “axed”) = 0

FIND (“Dashboards”, “a”, 2) = 2

FIND (“Dashboards”, “ash”) = 2

Use case of FIND function in Tableau

One of the use cases of FIND function is when extracting the domain name from an email address.

For example, extracting the domain part of this email “xyz@rigordatasolutions.com” using the following calculation.

MID (“xyz@rigordatasolutions.com”, FIND (“xyz@rigordatasolutions.com”, “@”)+1) =”rigordatasolutions.com”

The FINDNTH function

Syntax

FINDNTH (String, Sub-string, Occurrence)

This function returns the position of nth occurrence of sub-string within the specified string. Where n is defined by the occurrence argument.

Note, FINDNTH function is not available in all data sources.

For example.

FINDNTH (“Dashboards”, “a”, 2) = 7

FINDNTH (“Dashboards”, “s”, 2) = 10

I hope this short article was helpful to you. To receive more of the Tableau tips, kindly join our mailing list by subscribing below.

Thank you for reading.

Original.png

We Support You Deliver Business-Focused Solutions That Enable Data-Driven Decision Making.

  • Tableau profile
  • YouTube
  • White LinkedIn Icon
  • Facebook
  • X

QUICK LINKS

CONTACT US

+254 738 307 495

East Gate Mall, Donholm

3rd Floor Suite No. 3i

Nairobi, Kenya

Join our mailing list

bottom of page