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

Relative date filter with "Starting from..." includes 1 day outside the range when used on a date column #27566

Closed
BertrandToulas opened this issue Jan 9, 2023 · 1 comment
Labels

Comments

@BertrandToulas
Copy link

Describe the bug
When using a relative date filter with "Starting from" on a date variable (not timestamp!), the results also include the day after the desired date range.

Logs
JS console logs: multiple warnings with the following message:

Unknown MBQL Field clause 
Array(3) [ "+", (3) […], (3) […] ]
0: "+"
1: Array(3) [ "field", 42172, null ]
2: Array(3) [ "interval", 1, "month" ]
length: 3
<prototype>: Array []
app-main.bundle.js:2:500385

However, these messages also appear when using a timestamp column (which, unlike the date column, produces the correct output).

To Reproduce
Cannot be reproduced via the Sample Database currently because its time variables are all timestamps.
If you have a table with date variables, try the following:

  1. Create a filter on a date (not timestamp) variable
  2. Make it a relative date filter with a "Starting From" parameter
  3. Compare the indicated date range in the filter with the results; the results will include 1 day outside of the date range (e.g. Dec 1 if your date range is Nov 1-30)

See screenshots below.

Expected behavior
The relative date filter with "Starting from" should only output rows that are within the indicated date range.

Screenshots
image
image

Information about your Metabase Installation:

  • Your browser and the version: Firefox 108.0.1
  • Your operating system: Windows 11 22H2 22621.963
  • Databases: BigQuery, Postgres, H2
  • Metabase version: 0.44.6

Severity
This has caused me to create a number of comparative visualizations with inaccurate data.

Additional context
Our tables also have an event_timestamp column; doing the same query on those instead of the date column gave us the correct output.
Both the date column and the timestamp column are originally collected via Google Analytics 4 and imported onto our BigQuery database.

@flamber
Copy link
Contributor

flamber commented Jan 9, 2023

I'm quite sure it's a duplicate of #25481

@flamber flamber closed this as completed Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants