Looker Studio has recently introduced many new features. Some of the standout features include organizing fields within the editing mode and listing fields pulled from data sources1.
I believe it would be beneficial to publish a piece highlighting the new features introduced in Looker Studio, as well as customer requests I’ve frequently encountered. This article can be considered a follow-up to the article titled Looker Studio - Report Settings.
First, I’ll highlight a few points that are worth paying attention to during the report creation process. Then, under an experimental heading, I’ll present a few solutions that, while potentially useful in various scenarios, could lead to errors and performance degradation.
The examples discussed here are implemented in some of the reports available on the Products > Looker Studio Reports page. However, I would also like to emphasize that, generally, I tend to avoid such alternative solutions in reports that involve a large number of data sources and contain many calculated fields.
Things to Pay Attention to During Report Creation
When transferring data obtained through third-party tools—either directly or via a connector—into charts and tables, it’s important to pay attention to a few key considerations regarding both performance and accurate data representation.
Control Placement
Place controls (drop-down list, fixed-size list, input box, etc.) as high up on the page as possible. This allows users to filter data in the way they prefer and read charts from top to bottom, in order of importance.
Generally, data source, date range selection, source, campaign, age, and gender demographic information, country and city details, device types, and user types are considered at this stage. If the charts in the report are displayed within sections (section), then additional filtering operations specific to that section can also be shown within the same section. Sectioning can be implemented either on a single page or across multiple pages.
Additionally, if multiple pages are preferred, a filtering operation can be applied at the report level. In this case, it’s important to remember that if an element is included at the report level, it will appear on all pages. In such cases, an alternative solution for pages where visibility is not desired is to reevaluate the visibility order (order) of elements—meaning, the filter can be hidden at a higher level.
Interactive Filters
By enabling interactive filters for charts and tables, you can help the user focus on the data elements they are interested in, and easily visualize relationships between fields and time-based changes.
To enable this functionality, simply select the cross-filtering option located in the data (data) editing section under the relevant chart. Then, by selecting one or more fields on the charts and tables, you can highlight the relationships between fields.
Report-Level and Group Filtering
Dynamic Text Fields
Data Studio currently does not support interactive operation of visual elements2. However, several methods are available for this purpose. One of them is the visualizations and components developed by the community (community visualizations and components)3.
You can add numerous data visualization types developed by the community to your reports, provided you are cautious regarding data sharing and privacy. Once you view the relevant section, you will see various types of charts presented to you. However, charts and components not listed here can also be loaded via a URL specified with gs://4 5.
Conditional Content Component is a component that enables the creation of dynamic fields with conditional variability. This component can be accessed via the address gs://siavak-visualizations/range-viz6.
Experimental Operations
The operations under this heading are mentioned here only as examples. Using these operations may cause reports to load slowly, display incorrect data, and fail to provide data for the relevant fields where errors occur. So, which operations will I discuss under this heading?
- Dynamic text fields
- Visual links opened within the same pane
- Profile card
- Restricted time range operations
Conditional Content Component alternatively, we could consider a workaround that, while not quite a component, can still assist us at a basic level7.
We can pass data through various controls. The scorecard can also be used for such purposes, returning the result of the relevant operation. However, we can also perform the relevant operation using tables.
Actually, by creating a table and removing the header section, reducing the number of rows to [var]1[/var], and resetting the style properties (such as shadows, border lines, etc.), we end up with a usable dynamic field7.
For example, the text Currently displaying 30 days of data for the date range from Oct 19, 2021 to Nov 08, 2021 is used in the middle section of a report to remind users of which date range the data corresponds to.
The relevant text is defined as a one-dimensional (dimension) with the following content:
CONCAT(
'Currently ',
CAST(TODATE(CAST(MIN(Date) AS DATETIME), '%Y%m%d','%b %d, %Y') AS TEXT), ' to ',
CAST(TODATE(CAST(MAX(Date) AS DATETIME), '%Y%m%d','%b %d, %Y') AS TEXT), ' date range, ',
CAST(COUNT_DISTINCT(Date) AS TEXT), ' days of data are being displayed.'
)
You can examine the example usage in the Looker Studio - Content Performance report.
We can also use the aforementioned workaround, for instance, to transform a text into a multilingual structure. We’ll discuss this topic in the next section.
Language Selection and Variable Text
Dynamic Text Fields
We can also design the field under the “Dynamic Text Fields” section to change based on the selected language, just like report headings and other text fields. You can view the relevant process here.
For this process, we first need a list of languages. In my example, I used a Google Sheets table. The content of the relevant table is as follows:
| Short | Detail |
|---|---|
| TR | Turkish |
| EN | English |
Then, I selected this table as a data source and linked one of its columns to a dropdown field.
The next step is executed via formulas. Assuming we use the Short column, our conditional control will look like this:
IF(Short = 'TR', 'Anasayfa', 'Homepage')
Depending on the selection the user makes in the dropdown, that specific option will become active. In addition, you can also include conditional formatting (conditional formatting) features for the corresponding table cell that has been made interactive.
Visual Links Appearing on the Same Tab
Looker Studio allows us to create various links within a report and navigate across them on the same tab. Text-based links, in particular, can be easily created and linked to various page definitions (Next, Previous, Last, etc.). However, when visual elements are turned into clickable links, unfortunately a new tab or window will open upon clicking. This, of course, reduces the functionality of interactive elements such as navigation symbols (icons) within reports. However, this situation is certainly not without solutions.
You can review the report titled Looker Studio - Summary Report.
For this operation, we can leverage the link properties available for text. Yes, there won’t be a direct solution, but it will address our needs at a basic level.
The steps we should follow are as follows:
First, we’ll add an image to our report. Then, we’ll create a text file and fill its content with ___. Unfortunately, special characters (such as whitespace) cannot be used within this field. Therefore, we’ll need a character that doesn’t stand out visually. Then, we can link this text to a page or an external URL. After adjusting the text color based on the image’s background and modifying the line height (line-height), placing the text on top of the image will be sufficient. Now, when a user clicks on the image, the linked URL will open.
Profile Field
In this section, we’ll discuss the actions performed for the Authors in the report titled Looker Studio - Content Performance.
As previously mentioned in the article titled Looker Studio - Functions, Data Studio provides us with some customized functions related to data types. The IMAGE and HYPERLINK functions are two of those we can use for this purpose.
First, assume we have obtained user and/or author names from a source such as GA4 or another similar source. Naturally, this data will contain and lowercase letters, special characters, and spaces.
For example, let’s assume the user’s name is John Doe. In this case, when we use this value within URL, we end up with something similar to: domain.com/image/John Doe. Of course, this would not be a functional link. Therefore, creating a new dimension (dimension) based on this value would be appropriate.
IF(
author='(not set)',
'noone',
REGEXP_REPLACE(lower(author), '[\\W]', '-')
)
Now we can use this dimension to generate a visual path.
CONCAT('https://domain.com/image/', CONCAT(author-slug, '.png'))
We can record this operation as a new field and use it accordingly. Now we can also refer to this value as a visual path. Let’s assume we’ve created a JPG file corresponding to the relevant value. The table below clearly shows the data before and after the change.
If you’d like to use a rounded-corner visual, you can adjust the relevant image to match the report background color, or you can save it as a PNG with an alpha-channel. I also recommend using the CASE function in profile usage. This way, when a new user/author is added, you can display a fixed image instead of an incorrect one.
Considering the above operations at the report level will help you manage the relevant field more easily.
Limited Time Range Operations
Under the heading Dynamic Text Fields, we can access the selected date range at the report level using the MIN and MAX functions present in the example dynamic text field. After this step, we can compare our other date ranges using the corresponding date value.
For instance, let’s assume we can access a user’s registration date via the created_at dimension.
IF(created_at > TODATE(CAST(MIN(Date) AS DATETIME), "%Y%m%d", "%Y-%m-%d"), 1, 0)
With the above code, if the date when the user performed the registration is after the selected date, it will return a value of 1; otherwise, it will return a value of 0. Now, we can use this value for various purposes; the Sort field can also be one of these options.
*[JPG]: IMAGE/JPEG
*[PNG]: IMAGE/PNG
*[URL]: Uniform Resource Locator
Footnotes
- Data Studio ↩
- Can I display text from my data source in a text box? Is there support for text variables? ↩
- Introducing the Data Studio Community Visualizations Developer Preview. Google Marketing Platform ↩
- Sharing a Community Visualization. Looker Studio ↩
- Data Studio Community Component Library (dscc) ↩
- Ahmad Kanani. (2020). Conditional Content Component for Looker Studio ↩
- Looker Studio: Can I display the current date range a user is running a report at on screen in a text box? ↩ ↩2