Segments and Filters not working? AND Clause

Hi everyone,

I’ve been using the Segmentation feature in Matomo and noticed that it’s not functioning correctly. For example, if i choose “Country is not Germany” and “LandingPage URL is not www.Home.de” segments should exclude all visitors except those from Germany with Home as the landing page. However, other visitors (from other contries) are still being excluded from the report.

Is the “and” Clause not working correctly? Please share your experiences or any solution you might have. Thanks!

I’m not sure i understand what you mean.

Your filter is “Country is not Germany” and “LandingPage URL is not www.Home.de

So:

CASE 1 - user from Germany and Landing Page www.Home.de → FALSE (F&F=F)
CASE 2 - user from Germany and Landing Page NOT www.Home.de → FALSE (F&T=F)
CASE 3 - user NOT from Germany and Landing Page www.Home.de → FALSE (T&F=F)
CASE 4 - user NOT from Germany and Landing Page NOT www.Home.de → TRUE (T&T=T)

Correct?

Hey thanks for your answer.

What I mean is that I want to display all users where both conditions are NOT true.
CASE1 NOT From Germany and Landingpage is www.nothome.de ( should not be exluded because both conditions are not true )

CASE 2 From germany and LP is www.home.de ( excluded bc. both conditions are true)
Case 3 From Germany and LP is www.home.de (should not be exlcuded because not both conditions are met.)

Although ONLY the combination of both conditions should be excluded, other users from other countries will also be excluded.
Is this now more understandable?

Another simplified example:
Show me all users who are not male and not 62 years old.
Then men who are 65 years old, for example, should still be displayed.

Hi @Lynn_van_Mayer
Segments definitions are used for selection of visits, not exclusion of visits.
Then Simone is right in his cases illustration…

→ We agree

.

→ Sorry, I don’t understand your cases they are the same…

Try to be simple in your boolean calc, dont use negation of negation, it is hard to understand for you and for us (eg: “not be exluded” → “be included” - "both conditions are not true → “both conditions are false”) ; and in segment definition, the selection is made when the boolean value is true.

To help you, try to do a 2x2 table containing conditions, and when you want to keep visit:

Germany Out of Germany
LP = www.home.de ?? ??
LP = www.not-home.de ?? ??
|                        | Germany | Out of Germany |
| ---------------------- | ------- | -------------- |
| LP = `www.home.de`     |    ??   |       ??       |
| LP = `www.not-home.de` |    ??   |       ??       |

Hey,
thanks for your reply and sorry for the confusion.
What I am trying to achieve is to exclude only those users from the reports for which BOTH conditions are true.
Germany && LP = home.de

so in the table it would be like this:

--------------------------------- Germany Out of Germany
LP = www.home.de excluded included
LP = www.not-home.de included included

And yes, you’re right, I made a mistake with Case 3.
I meant:

Case 3 From Germany and LP is www.nothome.de (should be included one condition is false)

In this case you have to use OR

“Country is not Germany” OR “LandingPage URL is not www.Home.de

CASE 1 - user from Germany and Landing Page www.Home.de → FALSE (F|F=F excluded)
CASE 2 - user from Germany and Landing Page NOT www.Home.de → FALSE (F|T=T included)
CASE 3 - user NOT from Germany and Landing Page www.Home.de → FALSE (T|F=T included)
CASE 4 - user NOT from Germany and Landing Page NOT www.Home.de → TRUE (T|T=T included)

1 Like

Many thanks for the answer, but I don’t quite understand why you don’t have to choose “and- condition”.
Could you maybe explain that to me?
I thought “and-condition” meant that both conditions have to be true at the same time and “or-condition” that just one of the two has to be true.

With segments you define a filter, so you include (not exclude) all result that meet your filter.

You want to include every visitors except “Germany && LP = home.de”.

What you want is NOT ( Germany AND LP = home.de) but for De Morgan’s laws this is equal to (NOT Germany) OR (NOT LP = home.de)

1 Like