For professionals who actively use regular expressions in their work with data, the ability to use them in Looker Studio will be a valuable tool.
The functionality is bas! on several support! functions:
- regexp_extract — allows you to extract phone number database from a field a part of the value that matches a specifi! regular expression;
- regexp_match – returns true if the field value matches the specifi! regular expression, and false if it does not;
- regexp_replace – replaces all values corresponding to the specifi! field with the one specifi! in the function;
- regexp_contains – similar to regexp_match, but the difference is that regexp_match by default matches the entire value, while regexp_contains can search for part of the value.
Let me look at an example
It is necessary to analyze what users higher competition for lazmall sellers search for on the site using the internal search. First, you should filter the data by the parameters contain! in the URL of the internal search results pages (in our example, search=). The filter can be add! in the right panel of the table settings, in the “Data” section. The filter settings will look like this.
To understand what users are looking for, it is convenient to extract the search query from the URL. For this, you can use the regexp_extract(Full URL of the page,’search=(.*)’) function .
The result will be display! in a new column in the chart or table with the name of the calculat! field, in this case “Inner Lookup”.
And now it is much easier to analyze what and how often users search for on the site.
Using the case statement
Case is one of the most powerful europe email operators because it allows you to manipulate parameters and metrics. It is usually us! to create new categories or groups of data.
Operator syntax:
- condition – an expression that evaluates to a logical value (true or false), may include parameters or indicators, but not both;
- result – the value to be return!, can be a parameter, a metric, or any requir! value;
- else result – (optional) a default value that is return! if the condition in the “When” block is not met.
The CASE statement consists of one or more logical conditions (when) follow! by the result return! when they are met (then). If the conditions are not met, the CASE statement returns the value specifi! in ELSE.
A detail! guide to the operator can be found in the official documentation .