Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Data Studio displays "null" – how to set the field value?

Tags:

I am new to Google Data Studio. I think I have an issue, with turning dimensions into metrics or with correct assignement of values. This is because a colulmn which should display numbers just displays the string „null“.

This is how it should look. (Example from book) It should look like this with "real" numbers in the transaction amount column

But this is how it looks:

As you can see, transaction number is "0". And in the Data Control Panel on the right, "Balance" and "Transaction Amount" is a dimension (green) and not a metric – in the "Availabe Fields" panel

The column „Transaction Number“ is „null“.

I think sth. went wrong with the data source. It’s an CSV. Like this: This is the data-strcuture in the csv

And within Data Studio I transformed some of the field values and the Aggregation.

I don't get the fields like in the book. So for example "Balance" is a dimension – and not a metric. But I have the some type as in the book

I did not get Transaction amount blue colored, like it should be, (see example from book below) And also „balance“ is a not blue (metric.) enter image description here

I think, this leads to displaying transaction amount column to „null“. But I can’t turn these values into metrics from within the data control panel.

But maybe I am wrong. So what need Datas Studio to display actual values and not null?

like image 703
S.H Avatar asked Jun 29 '20 10:06

S.H


People also ask

How do I change NULL values in Google Data Studio?

Google Data Studio IFNULL function helps return a result if the input is null, otherwise, returns the input. IFNULL function is used to evaluate some input, look for the null values and replace null with specified value in the function.

How do I change my data studio to null to zero?

Replacing null to zero in Google Data Studio You only need to replace *METRIC* to the metric you need to use. This can be all kind of metrics, for example: pageviews, sessions, conversions etcetera. The formula to create a metric in Google Data Studio without NULL.

Why does data studio show no data?

If your data source appears to be missing fields that you know are in the original product, it's possible that field is not supported in Data Studio. You can check the issue tracker to see if the field has already been requested, or if not, file a feature request. Learn more about connectors.

How do I change the field type in Google Data Studio?

To change the field type, use the Type drop-down menu in the data source edit page. If the field editing in reports option is enabled for the data source, you can also change field types directly in reports based on this data source.


1 Answers

Summary

The number columns (Transaction Amount and Balance) are currently treated as Text columns in Google Sheets (one indication is the left alignment of the respective values, which is the default for Plain Text columns in Google Sheets), thus the symbols $ and , are part of the value thus $200,000.00 is treated a literal and is displayed as a Text field when creating the Google Data Studio Data Source.

One approach is to change the formatting in Google Sheets (or remove the respective characters $ and ,); the below looks at a suggestion within Google Data Studio by extracting the numbers from the field, using three steps:

1) Text

At the Data Source, ensure that both the Transaction Amount and Balance fields are set to Text fields.

A GIF to elaborate:

2) Calculated Fields

At the Data Source, create the two REGEXP_REPLACE Calculated Fields below and set the semantic type to Currency (USD):

2.1) Transaction Amount

CAST(REGEXP_REPLACE(REGEXP_REPLACE(Transaction Amount, "\\$", ""), ",", "") AS NUMBER )

2.2) Balance

CAST(REGEXP_REPLACE(REGEXP_REPLACE(Balance, "\\$", ""), ",", "") AS NUMBER )

2.3) Hide
Hide the original Text fields for Transaction Amount and Balance

GIF to visualise the above:

3) Metrics

Add the Newly created Transaction Amount and Balance Currency Fields into the required chart, such as Metrics in a Table.

Google Data Studio Report and a GIF to elaborate:

like image 160
Nimantha Avatar answered Sep 30 '22 19:09

Nimantha