Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I check if strings match?

I have a Google Sheet document that I only have read access to.

It has a set of workers in it. One of the fields is for "job location", and another is for "house location". When these fields don't match, the worker is "remote".

I'm trying to add a calculated column to a data source in Google Data Studio, but I can't find any string function that checks for equivalence, and just going J=K doesn't work.

The CASE operator isn't able to compare columns either.

Is there a way to make a formula determine if two fields are equivalent?

like image 228
Gustav Bertram Avatar asked Oct 28 '22 23:10

Gustav Bertram


1 Answers

For future reference, the feature was introduced in the 07 Jan 2021 update; thus using the fields specified in the question (job location and house location), the CASE statement below does the trick:

CASE
  WHEN NOT job location = house location THEN "remote"
  ELSE "not remote"
END

Editable Google Data Studio Report and a GIF to elaborate:

like image 157
Nimantha Avatar answered Jan 17 '23 07:01

Nimantha