The Wayback Machine - https://web.archive.org/web/20210813033754/https://github.com/cube-js/cube.js/issues/2866
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

dateRange 'Next 7 days' #2866

Open
chamabreu opened this issue Jun 1, 2021 · 4 comments
Open

dateRange 'Next 7 days' #2866

chamabreu opened this issue Jun 1, 2021 · 4 comments

Comments

@chamabreu
Copy link

@chamabreu chamabreu commented Jun 1, 2021

Describe the bug
If I pass 'Next 7 days' into the dateRange in query, the response is not a range over the next 7 days but only the day IN 7 days.

To Reproduce
Steps to reproduce the behavior:

  1. Build a query like this:
const query: Query = {
    measures: [
      measure
    ],
    timeDimensions: [
      {
        dimension: 'Your.Dimension,
        dateRange: 'Next 7 days'
      }
    ]
  }
  1. Send the request to CubeJS Api and watch the resultset timeDimension array. It returns not a dateRange over 7 days but only the one day in 7 days:
["2021-06-08T00:00:00.000", "2021-06-08T23:59:59.999"]

Expected behavior
Like the option to get the 'Last 7 days' like here.
This gives me an timeDimension Array of

["2021-05-25T00:00:00.000", "2021-05-31T23:59:59.999"]

The actual "last 7 days", and not the "one day 7 days ago".

Version:
0.27.14

Maybe there is not such an option 'Next 7 days'. I tried also '7 days from now' and other stuff.
Am I missing something?

@chamabreu
Copy link
Author

@chamabreu chamabreu commented Jun 1, 2021

Just found a solution that works:
'from now to 7 days from now'
gives me the expected result of
["2021-06-01T00:00:00.000", "2021-06-08T23:59:59.999"].

It's a solution, but I think 'Next 7 days' should work if 'Last 7 days' work, too.

@github-actions
Copy link

@github-actions github-actions bot commented Jun 4, 2021

If you are interested in working on this issue, please leave a comment below and we will be happy to assign the issue to you.
If this is the first time you are contributing a Pull Request to Cube.js, please check our contribution guidelines.
You can also post any questions while contributing in the #contributors channel in the Cube.js Slack.

@imrishabh18
Copy link

@imrishabh18 imrishabh18 commented Aug 6, 2021

@vasilev-alex Can I take up this issue?

@JoshMentzer
Copy link
Contributor

@JoshMentzer JoshMentzer commented Aug 11, 2021

@imrishabh18 Hey, I apologize - I worked this locally to fix an issue internally at my company and then came to do a PR up and noticed you had requested to work this issue; sorry for not checking ahead of time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants