Constrain your Data using Advanced XPath 4.1.1 Using the And Operator with Sub Predicates
Constrain your Data using Advanced XPath Am I misunderstanding this, or do the instructions need to be corrected for 4.1.1 Using the And Operator with Sub Predicates? https://academy.mendix.com/link/module/384/lecture/3104/4.1.1-Using-the-And-Operator-with-Sub-Predicates I added data grids on additional tabs to be able to see the # of results and be able to sort the results. I get the same 10,818 results, only US with >4000000 SalesYTD, from either of the queries in the instructions (pasted below). A data grid with no constraints returns a total of 31,465 results. A grid constrained only by the specified SalesYTD amount, returns 27,619 results with SalesYTD > 4000000, from a variety of countries. If I change the ‘and’ to an ‘or’ in their example B XPath, the grid returns all US results with any SalesYTD amounts and also other countries’ results with >4000000 SalesYTD. Maybe that’s what example B is meant to demonstrate? 4.1.1 Using the And Operator with Sub Predicates states: Open the list view in the tab Example A and set the XPath query to the query below: [Sales.SalesOrderHeader_Customer/Sales.Customer/Sales.Customer_SalesTerritory/Sales.SalesTerritory [CountryRegionCode = 'US’ and SalesYTD > 4000000 ] ] Open the list view in the tab Example B and set the XPath query to the query below: [Sales.SalesOrderHeader_Customer/Sales.Customer/Sales.Customer_SalesTerritory/Sales.SalesTerritory/CountryRegionCode = 'US’ and Sales.SalesOrderHeader_Customer/Sales.Customer/Sales.Customer_SalesTerritory/Sales.SalesTerritory/SalesYTD > 4000000 ] Run your application locally and look at the difference between the number of sales orders being retrieved.
Yes, I believe you are correct that its just to show variations on the data shown.
Your observation and comment, “Maybe that’s what example B is meant to demonstrate?“ seems accurate.
I believe it is talking about the retrieval and comparison mechanism of the objects.
In example A its applying all the conditions and then returning the results.
While in example B its making two retrieves and then applying INTERSECTION on them and results are SAME.
As in advanced learning paths you find out "and” operation is replaced by an set intersection operation.