Coder Social home page Coder Social logo

Comments (6)

GSapiah avatar GSapiah commented on June 2, 2024

Just had a look at the code and I can see that parameters with only "all" are shown.

if (dashboardParameter.allowableValues.type === 'all' && (dashboardParameter.dataType === 'date' || dashboardParameter.dataType === 'date-time'))

Any particular reason why?

from extension-date-updater.

KeshiaRose avatar KeshiaRose commented on June 2, 2024

Hi @GSapiah,

It was done to make sure the extension would work more reliably. If there is a list or range, the date that is supposed to populate in the parameter might fall outside of that range and cause the extension to not be able to update the parameter. Is there a particular reason you need the list or range option on the parameter?

Take care,
Keshia

from extension-date-updater.

GSapiah avatar GSapiah commented on June 2, 2024

Hi @KeshiaRose ,

I'm creating a report for which the users can only select the month rather than a specific date. The current month should be selected by default. I should be able to build the range based on a data source and that might fix the "parameter falling outside the date range" issue.

image

from extension-date-updater.

KeshiaRose avatar KeshiaRose commented on June 2, 2024

Hi @GSapiah,

Got it! Are all the possible months a user would want to select from found within your data source? If, so you could also use Data-Driven Parameters to achieve this.

  1. Create a source sheet that has all the dates from the data source at the month level.
  2. Bring this sheet to the dashboard (you can hide it by making it 1x1 pixels).
  3. Bring in the Data-Driven Parameters extensions.
  4. In the configuration choose an open date parameter, your source worksheet, and the date field.
    Optionally you can add a second field for formatting the dropdown.
  5. On the options tab, change the sort to descending and choose to ''Automatically reset values on dashboard load."

This will give you a parameter control you can use on the dashboard that will always default to the latest month in the data set and still allow for month selection by the user.

Would this work for you?

Take care,
Keshia

from extension-date-updater.

GSapiah avatar GSapiah commented on June 2, 2024

Hi @KeshiaRose ,

This extension might not work for us since it would always default to the latest month. Let me know if this is not the case.
In our use-case, the data range would be for "Current - 24 months" to "Current + 36 months" with current month always selected by default. The user can select any month in that 5 year range.

Just so you know, I've managed to create a dropdown for Current Month in your date-updater-extension with date being set as follows:
case Dates.CurrentMonth:
date.setDate(1);
break;

from extension-date-updater.

KeshiaRose avatar KeshiaRose commented on June 2, 2024

Hi @GSapiah,

I see, nope, that won't work. Seems like you've already started on my next suggestion, which is to take the code and modify it to fit your needs and host it yourself. That way you can customize it to your exact use case. Let me know if you have any trouble setting this up! I'm going to close this ticket as I think that is the best option in this case.

Take care,
Keshia

from extension-date-updater.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.