cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Data filter usage

SOLVED

Data filter usage

Hi,

I wanted to use the data filter widget but am not able to get the exact out. This is the service i wrote for filtering.

var query =
{
"filters": {
"type": "And",
"filters": [
{
"type": "Matches",
"fieldName": "ParameterVal",
"value": "*"
},
{
"type": "Matches",
"fieldName": "AlarmCategory",
"value": "*"
}
]
}
};

var params = {
ValueQuery: Query /* STRING */,
CategoryQuery: Query /* STRING */
};

// result: INFOTABLE dataShape: DataFilterTesting_DS
var result = Things["TestingThing"].DataFilterTesting(params);

 

DataFilterTesting is another query which has (select * from AlarmType where AlarmCategory = [[CategoryQuery]] or ParameterVal = [[ValueQuery]])

 

How am I suppose to proceed? Please provide some help.

Thanks,

Shalini V.

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Data filter usage

You are combining TW standard Query parameters with SQL services, and it's now how it works.

 

If you are using standard TW query features, you have to relay on Query services like:

  1. SearchAll/Data/ModelEntities/...
  2. QueryImplementingThings/WithData/WithNamedPro....
  3. and others alike (Infotable query features)

On thouse services you will be able to use the query like parameters you wrote.

 

If you are connecting to a custom database then you can't use the previous query services and format and you should use the standard SQL query formating for the given database on SQL services.

3 REPLIES 3

Re: Data filter usage

Hi @svisveswaraiya-.

 

Can you show us DataFilterTesting?  Also, you indicated you were not able to get the exact output with the data filter widget.  What output are you expecting?

 

When you run this, are you actually using wildcards or is that just an example?

 

Please provide further details and we will try to assist.

 

Regards.

 

--Sharon

Re: Data filter usage

You are combining TW standard Query parameters with SQL services, and it's now how it works.

 

If you are using standard TW query features, you have to relay on Query services like:

  1. SearchAll/Data/ModelEntities/...
  2. QueryImplementingThings/WithData/WithNamedPro....
  3. and others alike (Infotable query features)

On thouse services you will be able to use the query like parameters you wrote.

 

If you are connecting to a custom database then you can't use the previous query services and format and you should use the standard SQL query formating for the given database on SQL services.

Re: Data filter usage

Hi @svisveswaraiya- 

 

If the solution provided by @CarlesColl answered your question, please mark it as the Accepted Solution for the benefit of others with the same question.

 

Regards.

 

--Sharon