In Google Data Studio, the
STARTS_WITH
function is a powerful tool that provides users with the ability to analyze textual data on a more granular level. It's engineered to compare an input field or expression with a specified text and returns a boolean value (True
if the field begins with the particular text or False
otherwise).
The rudimentary layout of the
STARTS_WITH
function looks like this:
STARTS_WITH(X, text)
Where:
X
: It could be any field or expression which we want to examine.text
: This would be the exact text string which we want to look for in X
. It could be a literal value, field or expression. It's critical to note that text
is case-sensitive.To use the
STARTS_WITH
function, you simply need to specify the field or expression you want to examine as X
and then the text string you're searching for as text
. If X
starts with text
, the function will return true; otherwise, it will return false.
Let's bolster our comprehension with some sales metrics related examples.
Suppose we've a column 'Product' with names of various products and we want to find out if the name of the products begin with 'Laptop'. Here's how we put this function into action:
STARTS_WITH(Product, "Laptop")
If the product name starts with "Laptop", it will return true. For instance, if we've "Laptop - Dell Inspiron" in our product list, the function will return true for this item.
It's important to keep in mind that the
STARTS_WITH
function only checks the beginning of the string specified in X
. It does not identify whether the text occurs anywhere else in the string. Additionally, being case-sensitive, STARTS_WITH("Summer", "summer") will return false as "Summer" is not the same as "summer".
When you want to check if a string begins with a specific text, the
STARTS_WITH
function can be highly useful, especially when coupled with conditional fields or filters in Google Data Studio. It can be particularly powerful when analysing campaign names, product names, or sales descriptions where a naming convention has been applied.
Needless to say, the
STARTS_WITH
function is a potent little tool that helps in providing deeper insights into the textual data and can become instrumental in driving informed data decisions.Become a Looker Studio expert
for free
Learn all the secrets of data analysis and create beautiful and effective dashboards thanks to our 30-second video courses! Join Catchr's community on YouTube.
Get more video lessonsAll your data on Looker Studio
Build Looker Studio dashboard easily with your marketing data from all platforms and track your essential KPIs! No-code integration.
Start free trial now!Optimize your data analysis
Get free Looker Studio dashboard template among a large collection of +50 stunning template! Elevate your data visualization.
Get free templates!