• Beta
Tips & Tricks
  • 02 Sep 2020
  • 1 Minute To Read
  • Contributors
  • Print
  • Share
  • Dark
    Light

Tips & Tricks

  • Print
  • Share
  • Dark
    Light


Prevent applying filters in some of the charts

In Edit Dashboard , there is Filter Option :
Login_Preset

In the filter option it is possible to select the filters to apply in each of the charts.
Login_Preset


Days Interval Grouping in Bar Charts

In the customize tab you have an option to sort based on the series.
Login_Preset

However you have to have the intervals sorted. In my example you can see that I add 1-<30 days, 2-30-60 days, etc.
I am not sure how you did the interval section. In my example :
1- I took your data and loaded in a table

CREATE TABLE sales_test (
	customer VARCHAR(10)
	,ammount NUMERIC(9, 2)
	,sales_date DATETIME
);

2- I created a view at the top of the table to calculate the interval with Sysdate() so it is updated

CREATE VIEW sales_test_interval AS
SELECT *
	,datediff('day', sales_date, sysdate()) AS sales_interval
FROM sales_test;

3- I use Calculated fields in superset to put the interval in 'buckets'
metrics

Login_Preset

CASE 
		WHEN sales_interval <= 30
			THEN '1- < 30 Days'
		WHEN sales_interval BETWEEN 31
				AND 60
			THEN '2- 30-60 days'
		WHEN sales_interval BETWEEN 61
				AND 180
			THEN '3- 60-180 days'
		WHEN sales_interval > 180
			THEN '4-More 180 Days'
END

How to avoid aggregation in the Database and do it in Superset

A query fails because the aggregation granularity is not supported by the driver. This issue should be reported so it is resolved but as workaround it is possible to avoid the aggregation in the database and use Superset to do the aggregation as the example provided

Login_Preset


Create chart with 2 or more data sets

Superset supports 2 or more dataset in a chart only in the line charts and works as a combination of charts.

A- Create a line charts

Example :

Chart 1: Confirmed_test Chart

Login_Preset

Chart 2 : Death_Test Charts
Login_Preset

Chart 3 : recovered_test charts
Login_Preset

B- Create a chart that combine the 3 charts ( 3 charts can come from different data sources )

1- Select a data source

2- Select Dual or Multiple Chart Line Charts

Login_Preset

3- Select charts to present in X and Y axis

Login_Preset

In this Chart it is not possible to see the query or Run in SQL Lab


Change the default limit of rows in charts

You can change the default limit in charts by just overwritting the values and select "Create New Value "

select_limit

Was This Article Helpful?