Hi There,


i have some problem with the filter in the aggregate. So, i have VarCluster as variable.

If VarCluster value is 0 then will show all data. 


this is my filter condition.

Cluster.id = If(VarCluster.Id = 0 , not(NullIdentifier()) , Cluster.id)


Thanks for your help.

change to following :

Cluster.Id = VarCluster.Id or VarCluster.Id = NullIdentifier()


Dorine

Solution

Hi,

Assuming that VarCluster is a Record or Structure (as per your code):

VarCluster.Id = 0 OR Cluster.id = VarCluster.Id

But if VarCluster is only an Identifier (as usual, it is should be), with a more appropriate name (VarClusterId), you could do like this:

VarClusterId = NullIdentifier() OR Cluster.id = VarClusterId

The idea is the same:
The external variable value does keeps the same to all lines in the entity. So, if a condition with him is true, anything extra you put with OR in the filter will be ignored, and the filter will be true to all lines (show all).

I the comparison returns False, then the result will depend on the other parts of the filter.
So, you are using the external variable as a kind of Switch, that turns on and off the other part of the filter.

Cheers.

Solution

Eduardo Jauch wrote:

Hi,

Assuming that VarCluster is a Record or Structure (as per your code):

VarCluster.Id = 0 OR Cluster.id = VarCluster.Id

But if VarCluster is only an Identifier (as usual, it is should be), with a more appropriate name (VarClusterId), you could do like this:

VarClusterId = NullIdentifier() OR Cluster.id = VarClusterId

The idea is the same:
The external variable value does keeps the same to all lines in the entity. So, if a condition with him is true, anything extra you put with OR in the filter will be ignored, and the filter will be true to all lines (show all).

I the comparison returns False, then the result will depend on the other parts of the filter.
So, you are using the external variable as a kind of Switch, that turns on and off the other part of the filter.

Cheers.


Thanks Eduardo, this work like charm !