Search code examples
chartsserieslooker-studio

Google Datastudio multiple repartitions and types chart


I'm using Google Datastudio and I'm blocked on something weird.

I want to make a chart with globally series and detailed series.

But to do that I have 2 different repartitions and I don't know how to do that.
This is a sample of my data set:

Type Detail Country Value Date
type1 uk 60 000 2018-12-04
type2 detail-1 uk 15 000 2018-12-04
type2 detail-2 uk 11 000 2018-12-04
type2 detail-3 uk 4 500 2018-12-04
type1 usa 78 000 2018-12-04
type2 detail-1 usa 40 000 2018-12-04
type2 detail-2 usa 17 000 2018-12-04
type2 detail-3 usa 11 5000 2018-12-04

I want a series base on "Type" and another on "Detail", then I should use filter for different countries.

How can I do that? I spent a lot of time on this simple problem, but I can't achieve this.

My data comes from SQL Cloud for MySQL

It would be something like this :

enter image description here


Solution

  • Based on your data you need to create and use a 3rd dimension

    case when Detail is null then Type else Detail end
    

    or if Detail actually = '' then

    case when Detail = '' then Type else Detail end
    

    or to be sure

    case when Detail is null or Detail = '' then Type else Detail end