• 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.

Dashboard Filter

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

  • Dashboard Filter

    I have a dashboard app that contains 4 widgets showing various metrics for all 3 of our warehouses.

    I would like to add the ability for someone to click a button, dropdown, or side menu that causes each widget to filter on data for a specific warehouse. They should also be able to select the "un-filtered" view.

    What is the best approach? I've watched the diaries on side navigation, but I'd like to "reuse" the widgets if at all possible.

    TIA

  • #2
    Making use of vvIn_virtual is likely your answer. Can you post back what one of the data sources looks like now?

    Comment


    • #3
      This is one of 4 charts...
      Code:
      SELECT
      whs_nbr,
      sum(case WHEN bin = 'TRK' THEN est_moves END) AS trk_moves,
      sum(case WHEN bin <> 'TRK' THEN est_moves END) AS primary_moves
      FROM
      v_replenishment_by_loc
      GROUP BY
      whs_nbr
      The SQL view is pretty complicated

      This is another:
      Code:
      SELECT
      com_nbr,
      sum(case WHEN bin = 'TRK' THEN est_moves END) AS trk_moves,
      sum(case WHEN bin <> 'TRK' THEN est_moves END) AS primary_moves
      FROM
      v_replenishment_by_loc
      GROUP BY
      com_nbr
      ORDER BY
      com_nbr
      Note that this one does not contain warehouse number that I would like to filter on (however it exists in view v_replenishment_by_loc)

      The other two data sources are similar

      Comment


      • #4
        You can try something as follows:

        Modify your sql statements to contain a where clause using vvIn_virtual
        Code:
        SELECT whs_nbr, sum(case WHEN bin = 'TRK' THEN est_moves END) AS trk_moves, sum(case WHEN bin <> 'TRK' THEN est_moves END) AS primary_moves
        FROM v_replenishment_by_loc
        where  vvin_virtual('whereStmt', '1=1', 'char', 30, NULL, 'false')
        GROUP BY whs_nbr
        In your app, create the following app variables: whereStmt and reloadData

        Link the reloadData app variable to the refresh property of every widget.

        Now you can set the value of the whereStmt app variable when the user clicks the button to view warehouse 3 (for example). When clicked:

        - Set app variable whereStmt to whs_nbr = 3.
        - Set app variable reloadData to true

        Copy this step over for each warehouse.

        To view all results again, set whereStmt to 1=1.

        Comment


        • #5
          Thanks! I'll give that a try.

          Comment


          • #6
            Thank you once again!

            That works like a charm

            Comment

            Working...
            X