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

Drill-to-detail on a table chart with time grain = month only returns records from the first day of month #23847

Open
sfirke opened this issue Apr 27, 2023 · 5 comments
Labels
#bug Bug report validation:validated A committer has validated / submitted the issue or it was reported by multiple users

Comments

@sfirke
Copy link
Member

sfirke commented Apr 27, 2023

Drill to detail on a month should return all records from that month. On a table chart, it returns only records from the first day of the month.

How to reproduce the bug

  1. Create an aggregate table chart with a datetime variable as a dimension
  2. Select Time Grain = Month
  3. On dashboard, Drill to Detail by Month.

Expected results

See all results for that month (or month & other variables, if drilling by all).

Actual results

Only records matching the first day of the month are returned. I ran a trace on my data warehouse and can see the SQL query is only asking for the first day of the month:

SELECT TOP 50000 COUNT(*) AS [COUNT(*)]
FROM dbo.[myDataTable]
WHERE date_completed >= CONVERT(DATE, '2023-01-01', 23)
  AND date_completed < CONVERT(DATE, '2023-04-27', 23)
  AND date_completed = N'2023-03-01T00:00:00.000Z'

(The first two date_completed lines come from a dashboard native filter time range).

Screenshots

How I'm drilling:
image

Chart setup:
image

Environment

(please complete the following information):

  • browser type and version: Firefox
  • superset version: 4.0.2 (first noticed this in 2.1.0)
  • Data warehouse: Microsoft SQL Server
@sfirke sfirke added the #bug Bug report label Apr 27, 2023
@rusackas
Copy link
Member

Well, you know the "we don't support 2.x" party line I'm using ;) Is this still a thing in 3.x?

@sfirke
Copy link
Member Author

sfirke commented Feb 29, 2024

@rusackas Yep I just updated the original post to indicate I've validated it in 3.1.1.

@sfirke sfirke added the validation:validated A committer has validated / submitted the issue or it was reported by multiple users label Feb 29, 2024
@rusackas
Copy link
Member

I assume this one is still happening in 4.x, but it's getting a little stale. Seems not many people are running into this.

@sfirke sfirke changed the title Drill to detail on month only returns records from the first day of month Drill-to-detail on a table chart with time grain = month only returns records from the first day of month Aug 26, 2024
@sfirke
Copy link
Member Author

sfirke commented Aug 26, 2024

Yes, I confirmed that this is still happening in 4.0.2. I updated the issue title to be more specific that this only affects table charts.

I tried to figure out where in the codebase changes would need to be made, I wonder if it's here since it only affects table charts and mine would have a pivot operation:

if post_processing.get("operation") == "pivot":

Also kind of wonder if it could be SQL Server-specific, maybe someone using a different data warehouse could try to validate.

@nemosdo
Copy link

nemosdo commented Nov 8, 2024

I have the same problem, please let me know if you have any progress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
#bug Bug report validation:validated A committer has validated / submitted the issue or it was reported by multiple users
Projects
None yet
Development

No branches or pull requests

3 participants