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

Feature Request: Allow to Define a Default for {{variables}} #38

Closed
davismtl opened this issue Feb 8, 2017 · 10 comments
Closed

Feature Request: Allow to Define a Default for {{variables}} #38

davismtl opened this issue Feb 8, 2017 · 10 comments
Milestone

Comments

@davismtl
Copy link

davismtl commented Feb 8, 2017

I use {{variables}} frequently in my queries however the browser often forgets them so I need to keep re-entering them. Or if Re:Dash remembered queries, they are likely no longer valid.

Also, if I schedule the queries to run weekly, I don't know what variables they will use or if the schedules will even work.

User Story:
As a user, I would like to be able to define a default value for my query variables.

For example, if my variable is a date, I would like to define that default is today's date - 30 days.
This brings us up to par with most data tools that have date pickers that default to last 30 days.

@arikfr
Copy link

arikfr commented Feb 8, 2017

You can set a default value -- if you have a value set for the parameter, when saving the query, then this value will be used as default.

Scheduling doesn't work for queries with parameters. Although in theory we can use the default value here.

@davismtl
Copy link
Author

davismtl commented Feb 8, 2017

Any best practice to set the default value of a date to be today or today -30? These are typical default start and end dates.

Use case: I often define date ranges in my queries and if the query remembers the last date entered, then it would it hard to schedule the query to refresh in the future.

@arikfr
Copy link

arikfr commented Feb 8, 2017

Unfortunately nothing for this :( One thing you can do is to have # of days in as parameter, for example:

current_date - {{days}}

So by default you can have 0 or 30 there. But that's an ugly workaround.

@davismtl
Copy link
Author

davismtl commented Feb 8, 2017

I use that work around for a lot of my charts in my dashboard but then it makes it hard to just go look at a past period like the month of November.

Any chance we turn this issue into a feature request?

@rafrombrc
Copy link
Member

Sure, we triage new issues from this tracker every Friday, if you repurpose the title to describe the ask more clearly we'll slot it in to our schedule.

@davismtl davismtl changed the title Defining a default variable Feature Request: Allow to Define a Default for {{variables}} Feb 8, 2017
@davismtl
Copy link
Author

davismtl commented Feb 8, 2017

Done. I renamed the issue.

@rafrombrc rafrombrc added this to the m3 milestone Feb 14, 2017
@rafrombrc rafrombrc assigned washort and unassigned washort Feb 14, 2017
@rafrombrc rafrombrc modified the milestones: 2, 3 Feb 17, 2017
@rafrombrc
Copy link
Member

Looking back through this conversation, there are actually two separate issues that have been surfaced:

  1. We'd like to be able to use "current_date" as a default parameter
  2. We'd like to be able to have scheduled queries use a default parameter just like non-scheduled queries can.

I've opened #43 and #44 to capture these requirements, am closing this issue.

@davismtl
Copy link
Author

@rafrombrc
Would your #2 include if no value is defined, default to X? Where X could be a date, string or int/float.

Examples: default to "release". Or default to version "51.1". Or default to value greater than "5" bookmarks.

@rafrombrc
Copy link
Member

If I'm understanding you correctly, that's exactly what I'm saying. Right now you can do this with non-scheduled queries, simply by setting the parameter value and then saving the query. You can't do it with scheduled queries, however, and issue #43 captures that feature request.

@davismtl
Copy link
Author

Perfect! thanks!

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

No branches or pull requests

4 participants