• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

Set Filter value and refresh widget from button pgm

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Set Filter value and refresh widget from button pgm

    I have 2 chart widgets that I am trying to automatically filter and load based on a 3rd grid widget.

    The grid has a date filter to show a set of transactions for a date.
    Chart 1 shows a bar chart by hour showing number of transactions per hour.
    Chart 2 shows a column chart by day showing number of transaction per day for the month based on the date filter in the grid.
    I have logic in a button program and in the filter programs for each widget to update the filter values in the other widgets.
    I can update the filter values using app variables. But how can I automatically apply the filter once the filter values are set?
    Tried 'refresh' and the grid is refreshing, but the underlying data is not getting required.
    Part of the issue, I believe, is that the data source is refreshed in the filter program based on the filters. So just executing a 'refresh' in Valence is not reloading the data source.

    Associated question: The filters are on date fields and are using 'from' and 'to' values (a 'between' filter). I set both the 'from' and 'to' values but I only see either the 'from' value or the 'to' value getting set.
    In one Chart I see the 'from' date get set, in the other chart I see the 'To' value get set. And it is consistent. Chart 1 always only shows the 'To' value and chart 2 always only shows the 'From' value.

    Again, thanks for your attention.

    Paul

  • #2
    It sounds like the refresh is not taking into account that the user filters may have been updated dynamically via an app variable. We will have to take a look into this.

    As far as your other issue...this sounds like a bug. We will take a look at this too.

    I do have a question on your application. Do you necessarily want each widget to have its own set of date filters. It sounded like it was based on the filter range of the grid, correct? If that is the case...then we can suggest another approach to get you working now.

    Comment


    • #3
      Sean,
      The linking of the charts to the data grid is an optional thing. I have a toggle button to link the charts or not as the user requires.
      And each chart needs have the flexibility to have it's own filters.

      That being said, I am curious about your other approach.

      Thanks,

      Paul

      Comment


      • #4
        Following up on this topic: If there is anyway you can help with this I would appreciate it.

        I have modified my app.

        There are 3 widgets. 1) Data Grid with a date column, among others. 2) Bar chart, each bar represents an hour of the day and the number of orders entered within the hour. 3) Column Chart, each column represents a day and the number of orders recorded in that day.

        (see attached doc for a visual )

        Behaviors:
        1. Click on grid: 1.) bar chart will show the orders for the date of the record clicked. 2) column chart will show all orders for the month of the date of the record clicked.
        2. Click a date in the column chart, and the bar chart above it will change to reflect the orders for that date clicked.
        This is not working as I had hoped. I am attempting to make this work by setting the filter fields in the widgets. In both charts I have app variables to set the from and to value, but the date range only sets either the from date or the to date, but never both.
        For each filter field I have an AppVariable to set the value. I have tried using the SetAppVar behavior in NAB for the OnClick on the grid and also tried using a button program and have the button program set the appvars. The outcome is the same.
        Also, when the appvariables are changed and the filter changes the filter is not always applied, I need to click on the ‘Apply’ button to have it take effect.
        Attached Files
        Last edited by paultherrien; 11-22-2022, 02:47 PM. Reason: typos.

        Comment


        • #5
          Hi Paul,

          First looks like you discovered a bug when setting a filter field value via app variables when the filter is a between and we will make sure to get this fixed in the next release.

          With that said since it looks like the main driver is the grid to show the bar/column chart maybe you go the route of filtering those widgets via behaviors on the click of the grid and set those two widgets titles
          Last edited by Johnny Major; 11-22-2022, 09:03 PM. Reason: Res tex

          Comment


          • #6
            Thanks for your response Johnny, I was contemplating that same idea of using the widget title to reflect the chart parameters.

            Comment

            Working...
            X