Skip to main content

Hi everyone,

I'm currently using a nested filter in my view, and everything seems to work correctly — except in the tabular view.

Here’s what I observe:

  • In the tabular interface, the table shows 0 objects.
  •  However, when I click into the table, I can actually see that the instances are present. 

 

Below is an example of the nested filter I’m using:

Below is an example of the nested filter I’m using:
@view(
rawFilter: {
and: /
{
nested: {
scope: "Cement", "ScenarioContent"]
filter: {
equals: {
property: "ScenarioContent", "Type"]
value: "PLANNED"
}
}
}
},
{
nested: {
scope: "Cement", "ScenarioContent"]
filter: {
equals: {
property: "ScenarioContent", "IsLast"]
value: true
}
}
}
}
]

When checking the request, I see the following error:

{
"errors":
{
"message": "Client request(POST https://***/models/instances/aggregate) invalid: 400 Bad Request. Text: \"{\n \"error\": {\n \"code\": 400,\n \"message\": \"Nested filter scope can currently only be on the following properties from the cdf_cdm/cdf_idm space: icdf_cdm, CogniteActivity, assets], ,cdf_cdm, CogniteFile, assets], ,cdf_cdm, CogniteFileCategory, category], ccdf_cdm, CogniteTimeSeries, assets], ,cdf_cdm, CogniteTimeSeries, unit], ecdf_cdm, CogniteEquipment, asset], tcdf_idm, CogniteMaintenanceOrder, asset], rcdf_idm, CogniteNotification, asset], ncdf_idm, CogniteOperation, asset]. Attempted scope: tsp-test_planned_realized-knowledge_graph, Cement, ScenarioContent]\"\n }\n}\"",
"locations": o
{
"line": 3,
"column": 11
}
],
"path":
"aggregateCement"
],
"extensions": {
"classification": "DataFetchingException"
}
}
],
"data": {
"aggregateCement": null
}
}

 

It looks like the aggregation fails due to the use of a nested scope that isn’t currently supported — which explains the 0 object count.

What confuses me is: Why the objects still appear when opening the table manually.
 

Any insights or suggestions would be greatly appreciated!

 

 

 

Hi ​@Oussama ALLALI 

 

Thanks for the thorough summary.

As you have already observed - nested filters in aggregates are only supported for the properties mentioned in the error message as those are the only fields that are indexed in the backend.

 

Why the objects still appear when opening the table manually.

The instances in the tabular is fetched from the list endpoint, which does support nested filters. This is why the table is still being populated.

 

Regards,

 

Arild Eide

 


Hi ​@Adam Tombleson 

Thanks for your explanation.

Ok, I understand the count relies on the aggregate endpoint (which fails), while the table uses the list endpoint (which works).

This behavior is misleading for users. They think there’s no data when there actually is. We believe this a bug and would suggest aligning the count logic with the list behavior.  


Hi ​@Oussama ALLALI 

We do agree that the zero count is misleading.

As mentioned, supporting nested filters for any property requires broader and custom indexing and is a substantial undertaking.

For now, we should be able to at least not present a count of zero when there is no successful count obtained. I will raise a UI item to handle this part, at least.

 

Thanks

Arild Eide


Reply