Multiple boolean variables in aggregate filter (Sql query)

Multiple boolean variables in aggregate filter (Sql query)

  

I have a list of many records and I want to sort this by multiple filters.

This works fine, I get a list based on which filter I set. However, when I select multiple filters that refer to the same column, I don't get any results.

My current filters are like above, plus some extra filters on other columns.

I'm looking for syntax that will basically check if the signaal2.status column = all filters that are currently selected. 


Hi,


I think you should do this in one filter and more like

(Session.Signalen_geregeld = False or (Signaal2.Status = "Geregeld" and Session.Signalen_geregeld = True))
OR
(Session.Signalen_XXX = False or (Signaal2.Status = "XXX" and Session.Signalen_XXX = True))

because the seperate filters are "AND" filters.

which means you get

(Session.Signalen_geregeld = False or (Signaal2.Status = "Geregeld" and Session.Signalen_geregeld = True))
AND
(Session.Signalen_XXX = False or (Signaal2.Status = "XXX" and Session.Signalen_XXX = True))

which result to no records, because no Status is equeal to "Geregeld" and "XXX"

Solution

J. wrote:

Hi,


I think you should do this in one filter and more like

(Session.Signalen_geregeld = False or (Signaal2.Status = "Geregeld" and Session.Signalen_geregeld = True))
OR
(Session.Signalen_XXX = False or (Signaal2.Status = "XXX" and Session.Signalen_XXX = True))


So this didn't work, but gave me an idea. I found it works like this: 

(Signaal2.Status = "Geregeld" and Session.Signalen_Geregeld = True) or
(Signaal2.Status = "XXX" and Session.Signalen_XXX = True) or

Etc. I also put a statement in the same filter that checks if all session variables are false, so the full list gets shown. when there is no filter selected.

Thanks for the help!


Solution