7 Replies Latest reply: Nov 23, 2015 2:43 AM by Theo Klemming RSS

    How do apply date range as external parametrised filter

    Lalit Sethi

      Hi All,

       

      I am able to apply auto-parameterization external filter for single value using datawatch Javascript API .

       

      I would like to apply date range filter like as auto-parameterization. How I can do it?

       

      Example

      1)I do have  jquery UI calendar  which will select the date of birth between two dates.

       

      I have date_of_birth field as parameter.

      2) How I can add auto-parameterization for search box ?

        • Re: How do apply date range as external parametrised filter
          Theo Klemming

          Hi

           

          What release version of Datawatch Server for Visual Data Discovery are you using?

           

          Have you looked at the examples in this location of your server installation?

          http://<host>/<application>/api/#/examples

           

          For example, there is one example called "Control Parameters and their Updating".

           

          In general terms, this is done by calling the method

          DatawatchApi.setDashboardParameters()

           

          and specify the parameter name and a value on a format that your Datawatch data source expects.

            • Re: How do apply date range as external parametrised filter
              Lalit Sethi

              Hi,

               

              I am using 13.2.0 version . I gone through the example. This examples are very basic examples.

               

              I need to implement the range filter and search filter.

               

              Example for date_of_birth; column Added parameter and default value say 1988-01-01.

               

              If you look @ the parameters and query it uses IN functions but I would like to BETWEEN function.

               

              example

              WHERE date_of_birth BETWEEN '2000-02-07' AND '2007-02-15'; How I can implement this.

                • Re: How do apply date range as external parametrised filter
                  Theo Klemming

                  The condition for parameter value match is controlled in your data connection settings.

                  So, if you want a condition like BETWEEN x AND y, you depend on using a data source that supports using that type of instruction. For example, a SQL database where you add that to your query e.g. WHERE "columnName" BETWEEN {param1} AND {param2}.

                   

                  If you are using a connector that does not support the use of any query language, then you can only achieve EQUALS conditions, matching a single value or an array of values.

                    • Re: How do apply date range as external parametrised filter
                      Lalit Sethi

                      Theo Klemming wrote:

                       

                      The condition for parameter value match is controlled in your data connection settings.

                      So, if you want a condition like BETWEEN x AND y, you depend on using a data source that supports using that type of instruction. For example, a SQL database where you add that to your query e.g. WHERE "columnName" BETWEEN {param1} AND {param2}.

                       

                      If you are using a connector that does not support the use of any query language, then you can only achieve EQUALS conditions, matching a single value or an array of values.

                      Hi,

                       

                      I am using postgresql  datasource. Used as Query option. and wrote the query

                      SELECT "id","name","age","designation","salary" FROM "public"."emp_data"  WHERE "id" BETWEEN {param1} AND {param2}

                      but still getting error.

                       

                      Can you please suggest any documentation or steps. I m getting an error syntax error near "{"  routine scan error.

                      Unable to load data: ERROR [42000] [DATAWATCH][ODBC PostgreSQL Wire Protocol driver][PostgreSQL]ERROR: syntax error at or near "{"(Position 95;File src\backend\parser\scan.l;Line 1053;Routine scanner_yyerror;)