Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need multiple date filters in slice #4583

Closed
sanoopmm opened this issue Mar 9, 2018 · 14 comments
Closed

Need multiple date filters in slice #4583

sanoopmm opened this issue Mar 9, 2018 · 14 comments
Labels
inactive Inactive for >= 30 days

Comments

@sanoopmm
Copy link

sanoopmm commented Mar 9, 2018

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

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

Superset version

0.20.4

Expected results

When I try to create a slice and I have more than one Date columns, I need to specify multiple 'Time Column'. Also I need multiple date filters in the slice. According to the number of date columns, I need more number of date filters.

Actual results

Now only one 'Time Column' and only one date filter is possible even if more than one date columns are available in the table.

Steps to reproduce

  1. Create new slice
  2. specify the 'Time Column'
  3. Able to filter the data only by using the selected data column.
  4. Only one 'since' and 'until' available. I need More than one according to the number of date columns.
@SGSunil
Copy link

SGSunil commented Feb 28, 2019

Any workaround for this or plan to solve it.

@mistercrunch
Copy link
Member

Seems like a not so common use case, and can be worked around easily with the common filters and/or the WHERE clause.

@SGSunil
Copy link

SGSunil commented Feb 28, 2019

@mistercrunch thanks for the response, highly appreciated. I tried to use two filters for different time dimensions (system start date, complaint date). Only one works because in all the slices we have the option to provide only 1 time related form attribute, which can either be system start date or complaint date in my case. If I use a normal filter then I can't use last year, last 1 month etc. How you will solve such a use case.

@SGSunil
Copy link

SGSunil commented Feb 28, 2019

@sanoopmm are you able to find any workaround.

@SGSunil
Copy link

SGSunil commented Mar 2, 2019

@sanoopmm @mistercrunch I was able to achieve a workaround by creating a calculated column to know the current year (value = 1) and rest period (value = 0) and then using these two values in the filter slice.
calculated column = date_field >= DATE_SUB(NOW(),INTERVAL 1 YEAR)

@stale
Copy link

stale bot commented May 2, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue .pinned to prevent stale bot from closing the issue.

@stale stale bot added the inactive Inactive for >= 30 days label May 2, 2019
@rumbin
Copy link
Contributor

rumbin commented May 2, 2019

Please do not close.
Bi-temporal tables are fairly common, in my eyes. Like, e.g. event date vs ingest date. Or production date vs date of failure of products.

@stale stale bot removed the inactive Inactive for >= 30 days label May 2, 2019
@stale
Copy link

stale bot commented Jul 1, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue .pinned to prevent stale bot from closing the issue.

@stale stale bot added the inactive Inactive for >= 30 days label Jul 1, 2019
@stale stale bot closed this as completed Jul 8, 2019
@aleh-arol
Copy link

Up.
There's a common case - cohort analysis - e.g. having a table of events (thus event_date time dimension) with a "cohort_date" (another time dimension) column per event row showing the cohort date of the user we have event for. So 2 time dims and of course it would be highly desirable to have an ability to use dynamic UI time filters for bother of them - so to be able to say - show me events happened withing a time range for a cohort of users of April'2018.

Please advise on any meaningful workaround.

@musthak24
Copy link

Any updates ?

@FSHK
Copy link

FSHK commented Apr 6, 2022

So is not possible?

@itziarmj
Copy link
Contributor

We have also main uses cases in which we need two timing filters, one for the daily trends and another for a dimension of the data (like order date, release date...)
We have also some cases in which we need more than two, for example to analyse the status of requests that have multiple states.
Please advice on a workaround.

@zhaoyongjie
Copy link
Member

Hi @itziarmj I'm working on the PR, I will resolve this case.

@zhaoyongjie zhaoyongjie reopened this Oct 17, 2022
@rusackas
Copy link
Member

Since the fantastic work by @zhaoyongjie has merged, I'm going to call this issue closed. Please turn on the GENERIC_CHART_AXES feature if you need this feature. This flag will be deprecated/removed in a forthcoming major version of Superset, so you can consider this one completed, in beta, and on the road to being in everyone's hands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inactive Inactive for >= 30 days
Projects
None yet
Development

No branches or pull requests

10 participants