Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X
var query2 = {
"filters":
{
"type": "OR",
"filters": [{
"type": "NE",
fieldName: "name",
value:"ConsolidatedInfoFiles"
},
{
"type": "NE",
fieldName: "name",
value:"Health Summary"
},
{
"type": "NE",
fieldName: "name",
value:"Shiftwise Melt Consumption"
},{
"type": "NE",
fieldName: "name",
value:"Shiftwise Energy Consumption"
}
]}
};
var params1 = {
t: infoIT /* INFOTABLE */,
query: query2 /* QUERY */
};
var result = Resources["InfoTableFunctions"].Query(params1);
Solved! Go to Solution.
I found the solution. NE filter will work with AND filter thats the reason NE filter didn't work with OR (Demorgans law-¬(P∨Q)¬(P∧Q)
Can you provide more information? I.e. how your data looks like? What is the expected and what is the actual result?
input is info table. we are query the infotable based on name .the result is also a info table
I mean the content of the infotable. You try to query data with the above mentioned filter. What is the result? Do you get to many rows or none? Can you provide a specific example? Then it would be possible to reproduce the scenario.
The input Info table is of length 528 rows after the query it should return Info table of length 396 rows ,but it gives the output of info table of 528 rows .It means the query hasn't worked on the info table .I want to know why this is happening.
Hi @dev_1827 ,
Without an specific example (which means the input infotable, the query, and the expected and actual output) it is almost impossible to help you effectively.
The only thing I saw strange is the fact that for some keys you use quotes, and for some you do not. Was this intented?
which are the keys you are talking about?
If you check the JSON for yourself you will see that all fieldName and value don't have quotes.
I am not sure if this would impact or not the query, but it's something you should try quickly.
If that was the reason, the same query should have not been worked for Equal to filter of query .Right?. Although I have even tried it with the quotes it didn't work.
Why does the same query works for equal to(EQ) filter but not for not equal(NE) filter?
I was not aware that it worked for EQ filter - you never mentioned before this.
But now that I'm looking at your query in the morning, I believe the result that you see is the expected output.
Let's start from the beginning: with the OR logical operator, each infotable row will be checked so that at least one of the conditions there is satisfied.
The condition in the NE case is "field 'name' should not have value 'xyz...' "
Meaning that your query basically will return all the infotable, each time.
The condition in the EQ case is "field 'name' should be equal to value 'xyz...' ":
Can you please elaborate more on NE filter with OR logical operator ?
I didn't get the point you are trying to explain me.
I found the solution. NE filter will work with AND filter thats the reason NE filter didn't work with OR (Demorgans law-¬(P∨Q)¬(P∧Q)