superset icon indicating copy to clipboard operation
superset copied to clipboard

Filter Customization According to different needs

Open niranga-k opened this issue 7 years ago • 3 comments

Make sure these boxes are checked before submitting your issue - thank you!

  • [x ] I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • [ x] I have reproduced the issue with at least the latest released version of superset.
  • [ x] I have checked the issue tracker for the same issue and I haven't found one similar.

Hi all, I have been working with a project for past few days using Superset. My requirement is to filter results for a time period. Please have a look at the example.

github_question

I have several Big number charts and a bar chart as shown in the picture.

  1. Total Subscribers: Total number of subscribers as of today.
  2. New Subscribers: New subscribers for today.

Lets Say I have following numbers of subscribers per month.

January : 10 February: 15 March : 12 April : 8 May : 6

Lets say I selected the time Period as 1st February to April 30th, So the requirement is as following, Total Subscribers: 45 (10+15+12+8) New Subscribers: 35 (15+12+8)

From What I understand following is the filter required for each charts, Total Subscribers: From: ∞ To: 30th April New Subscribers: From: 1st of February To: 30th April

Is there any way to customize the time filter according to this? Is there anyway to customize time filters in charts? Do i have to change the code? Any type of answers are welcome. Thank you very much in advance.

Superset version

version": "0.29.0rc7

Expected results

Actual results

Steps to reproduce

niranga-k avatar Mar 18 '19 05:03 niranga-k

The time filter is limited to what it does (each chart defines the column it uses for time, and applies the dashboard's filtering event on that column)

To work around this, it's possible to:

  • design a chart that does not listen to any time filtering events http://superset.apache.org/faq.html#how-to-add-dynamic-filters-to-a-dashboard
  • use a normal filter instead of your time filter
  • add columns/expressions in your database that may help in using simpler filters (say something like days_since_customer_joined)

mistercrunch avatar Mar 18 '19 06:03 mistercrunch

Thank you for the quick reply @mistercrunch . But this does not solve my problem. Please let me know if there is anything I can do to customize the code.

niranga-k avatar Mar 18 '19 06:03 niranga-k

+1 on this

Neel-rishabhsoft avatar May 08 '20 04:05 Neel-rishabhsoft