Hi everyone, how are you? I have a question and I hope to find help here!
I’m creating a BI in Data Studio and I’ve run into a problem.
I use Google Spreadsheets as a database.
In this case, for this data set, I have the following databases:
Base 1: Companies
Base 2: Companies and Production
It turns out that there may be companies in Base 1 that are not present in base two, because they have no production.
When I do the union, I get the return of the production of the companies with production. However, I wanted to list all the companies (from base 1) in this table and link the active production of base 2, regardless of whether there is no production, I want it to return a zero value.
The problem is that I couldn’t do this at all.
I tried the following strategies:
I created a metric: IFNULL(Production, 0), and it didn’t work.
I tried another approach:
CASE
WHEN Production IS NULL THEN 0
ELSE Production
END
It didn’t work either.
And another attempt:
SUM(CASE
WHEN Production IS NULL THEN 0
ELSE Production
END)
But I was unsuccessful.
I’m using the outer combination on the left, because the base on the left is for companies.
However, I’ve also tried different types.
My knowledge is not advanced when I enter this junction of bases.
Could someone help me?