简体   繁体   中英

How do I get rid of all these null values in Data Studio?

I have created this Dashboard in Data Studio. That data has three categories "All Food" which is a combination of "Fruits" and "Vegetables" and then "Fruits" and "Vegetables" have their own category. I want to be able to have a control that lets you switch between the three categories and then a second control that will automatically update so you can pick the specific fruits and vegetables you want to see on the chart. Here is the data I have:

The data I'm using

The problem is when you click on "Fruits" all the "Vegetables" become "null" so you get this "null" bar that I don't want.

Dashboard Screenshot

Here is the code that I am using:

CASE Types
    WHEN "ALL FOOD" THEN "ALL FOOD"
    WHEN "Fruits" THEN Fruit 
    WHEN "Vegetables" THEN Vegatable 
END

Sorry if this is a bit of a noob question.

Here is a link to the dashboard I created so you can get an idea of what I am trying to do.

https://datastudio.google.com/s/iN-YdqlmD1w

Fixed it in your dashboard

CASE Parameter_Dummy
  WHEN "ALL FOOD" THEN COALESCE(Vegetable ,Fruit)
  WHEN "Vegetable" THEN Vegetable   
  WHEN "Fruit" THEN Fruit 
 END

在此处输入图像描述

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM