15 Replies Latest reply: Apr 25, 2016 2:29 AM by mtondeur RSS

    Passing filters values to parameters

    mtondeur

       

      Hello,

       

       

      In Datawatch Designer I have several Filter boxes (to be able to use the “Select All” feature) and I would need to use a unique “Apply Filters” button which should set different parameters values and so trigger the data source refresh.

       

       

      I have issue in the button action to set the parameters values from the filters values.

       

       

      Could you help please ?

       

       

      Thanks in advance.

       

      Michael

        • Re: Passing filters values to parameters
          Theo Klemming

          Hi Michael

           

          This is an attempt at making a short description of how you may be able to do what you need.

           

          For each parameter you are currently using in your query, add a "twin" parameter (right-click the dashboard tab and select Properties, then Add Parameters).

          For example, if your query uses a parameter called "myParam", you could add "myParam_step1" and so on.

          The filter box you currently have that sets the value of myParam should now be re-configured so that it no longer controls "myParam", but instead controls "myParam_step1". And in turn, you add an Action button, which you configure in such way that {myParam_step1} is supplied as the value that the button will give to "myParam". Thanks to providing myParam_step1 within curly brackets as the value you want the button to give to "myParam", you will achieve the effect of picking up what ever value the filter box has set. The difference is that the data is not reloaded until you press that single button. And of course, you can tie in any number of parameters and filter boxes to the single button.

            • Re: Passing filters values to parameters
              mtondeur

              Thank you Theo,

               

              It makes sense, but I think I still miss something because pressing the action button doesn't refresh the data with the filters values.

               

              1) "The filter box you currently have that sets the value of myParam should now be re-configured so that it no longer controls "myParam", but instead controls "myParam_step1"."

              --> 1.1 For this I need myParam_step1 as a field in a data source, and drop it in the filter box, isn't it ?

               

              2) "And in turn, you add an Action button, which you configure in such way that {myParam_step1} is supplied as the value that the button will give to "myParam"."

              --> 2.1 Is a navigation action ok (not script action) ?

              --> 2.2 What is the syntax in the action button to apply the value of myParam_step1 to myParam ? Is {myParam_step1} correct ?

              --> 2.3 Should I apply this change in the action button, in the action, both ?

              --> 2.4 Should I also change the defaults value of myParam or myParam_step1 in the dashboard properties to make the Automatic Parameterization working ?

               

              Thanks in advance for your help.

               

              Regards,

               

              Mike

                • Re: Passing filters values to parameters
                  Theo Klemming

                  Sorry Mike, it may be that I misunderstood from the beginning; when you wrote Filter Boxes, I was thinking about Action Drop Downs etc. I remember now that you explained previously how you need to be able to do Select All, and therefore you need to use the in-memory filters instead of parameters.

                   

                  HOWEVER: If you are indeed using in-memory filters, then there is no data source refresh involved. The data set in total is loaded into memory and filtered in memory, sort of like hiding things that you filter out.

                   

                  Since you wrote about "trigger the data source refresh" I immediately assumed Parameters and Actions. Please also see the answer by Jérôme below, where he explains the difference.

                • Re: Passing filters values to parameters
                  mtondeur

                  Hello Theo,

                   

                  In an action button, when {myParam_step1} is supplied as the value that the button will give to "myParam", it seems it can only work with a unique value, not multiple values, from {myParam_step1}. Is there any limitation here ?

                   

                  I well set Multiple option in the dropdown select, and checked Multiple in the action.

                • Re: Passing filters values to parameters
                  Jerome Gransac

                  Hi Michael,

                  I would like to mention that filters and parameters are two different stuff.

                   

                  In case this is necessary some explanation. When you apply a filter on a dashboard, it means that you are filtering the data already in memory that you got back previously from a query.

                  However, applying parameters means that you are going to query a database using a set of parameters values, then load this data in memory, then visualise them. I understand this is waht you want to do.

                   

                  For instance, you have a data Table in Designer that is able to get back a list of customers in different countries. If you decide to load the data from this data table using a parameter country = USA, then it means that the query will be something like select * from customers where country={my_parameter}, with my_paramter="USA".

                   

                  I see that Theo has written a note. This note is complementary to his.

                   

                  Jerome

                  • Re: Passing filters values to parameters
                    mtondeur

                    Theo, Jerome

                     

                    No pb, I am happy we have this discussion.

                    Indeed I know well the difference between filters and parameters.

                     

                    I have a constraint because I precisely need to have Parameters to refresh data from backend (live calculations) each time I do selection in the screens.

                    But as I also need to have the "Select All" feature in the selection checkboxes (requirement), I can only use Filters (not Dropdown Action).

                     

                    So my concern is how to pass the Filters values to the Parameters after the checkboxes choice, or with an action button.

                     

                    Thank you for your help.

                     

                    Mike

                      • Re: Passing filters values to parameters
                        Theo Klemming

                        Hi again

                         

                        Unfortunately, the values selected through Filters are not directly accessible for transfer or assignment to Parameters.

                        However, a visualization that has been filtered with In-memory filters will hand over only the non-filtered values to Parameters.

                        This opens up for a work-around that could potentially meet your needs.

                         

                        Consider this:

                        You have 2 data tables.

                        You have 2 visualizations, one for each data table.

                        Visualization nr 2 has Row Filtering disabled, meaning that is does not react to Filters.

                        Visualization nr 2 (data table 2) has various parameters, which can have multiple values (an array of values).

                        Visualization nr 1 (data table 1) loads data containing ALL available/possible values.

                        Visualization nr 1 is a heat matrix has one column assigned to the Breakdown (Rows) that contains the same value on each row, meaning that you get just 1 visual item. That item represents all rows of data table 1.

                        Visualization nr 1 can be filtered with check-box filters

                        Data table 1 has column names matching the parameters used in Data table 2, so the Automatic Parameterization will work, without need for creating custom actions.

                        Now, filter Visualization 1 using the In-memory filters.

                        Next, Double-click the single visual item in Visualization nr 1 in order to trigger a Parameter values update in Visualization nr 2.

                         

                        I have attached a workbook with data inside it that show this example.

                          • Re: Passing filters values to parameters
                            mtondeur

                            Hi Theo,

                             

                            Thank you for this trick, it seems to work fine... sometimes.

                             

                            I don't know why, in one of the dashboard, the double-click on the Heat Matrix (fake button) is impossible and the right-click option to "Set ..." the parameters is grey.

                             

                            Would you know a cause ?

                             

                            Mike

                            • Re: Passing filters values to parameters
                              mtondeur

                              Hi Theo,

                               

                              Thank you, your solution work fine.

                               

                              I have an additional request to make it absolutely perfect :

                              To make it work, user needs to double-click on the fake button, which is not very user-friendly.

                              --> Do you see any solution to make this work by a simple click ?

                               

                              Mike

                                • Re: Passing filters values to parameters
                                  Theo Klemming

                                  Hi

                                   

                                  I'm sorry, no - Normally, triggering an action from a visualization requires right-click and selecting from the menu. But, for visualizations that do not have a breakdown with several levels - in other words you cannot drill down - we have associated the double-click with "trigger the first action in the list" instead of associating it with drill-down. That is why double-click works here. Single-click is always for "select" in a visualization.

                            • Re: Passing filters values to parameters
                              mtondeur

                              Hi,

                               

                              Is it possible to check by default all the options in a parameter dropdown list ?

                              Or maybe to set the default value of a parameter with different values, for example something "Europe;Asia;America" for a continent parameter ?

                               

                              Mike

                                • Re: Passing filters values to parameters
                                  mperez

                                  Hi Michael Tondeur,

                                   

                                  I'm not sure if I understand your inquiry but I believed its possible to check and set the default value of a Parameter with different values in the Dashboard Properties. Right Click on the Dashboard Tab > Properties > General Tab

                                  Capture.JPG

                                   

                                  Hope this helps.

                                   

                                  Thanks.

                                   

                                  Migz.

                                    • Re: Passing filters values to parameters
                                      mtondeur

                                      Hi,

                                       

                                      Thank you Migz for your answer.

                                       

                                      But it seems we can not have several default value for the same parameter, for example if I want to set Region as Europe and Asia, something like "Europe ; Asia" doesn't work.

                                      My goal would be to make all the options checked by default in the parameter dropdown list, instead of only the first one by default.

                                       

                                      Do you think it's possible ?

                                       

                                      Regards,

                                       

                                      Mike