I created a segment from different entity that has relation with Contact using different bloc (Union) and it works. I tried to create the same query in teh same bloc and it doesn't work (members don't show). Please see attached file. The first Screenshot is the one that doesn't work.
Is there any rule that I may have missing?
Thank you very much for your help.
Nima31, I think you're asking why your two segments don't produce the same results. The queries are not logically equivalent--the one using UNION should typically produce many more results. I'd have to test it, but I think using INTERSECT instead of UNION would make the two queries the same.
Hi Nima31,
Could you share detail of "the one with union is not showing the same number of contacts" means?
-> Do you mean there is one segment that hasn't estimated result as you checked by advanced find?
-> Do you mean you can get right number of contacts with "Contact (Contact -> Account (Company Name))" relationship but the final estimated result is not right when you union another segment as you screenshot?
(While number of each segment is right)
Because Union just combines all members of the two groups, so you could check whether there is one of segment hasn't right number.
Please check both your segment query filters and advanced find filters, and share screenshot of them if possible to let us review whether anything is not correct.
In addition, you could try other query block operators to meet your requirements:
Regards,
Clofly
Hello,
Thank you very much for your help. It works and it shows the right number of contacts (I checked with advanced find). However, the one with union is not showing the same number of contacts.
Since we can user either the same bloc or union, what should I put the Query ( with union) to get the same result please?
Thank you!
Hi Nima31,
As Karl suggested with his explanation, the reason would be relationship Contact -> Account (Account),
while Contact -> Account (Company Name) is actually what you need.
You could find detailed description of relationship definition in segment via link below:
Contact -> Account (Company Name) will query all contacts by specifying their parent account(Company Name) value,
(account is starting side, Company Name is a lookup field for contact entity, Contact -> Account is N:1)
so your requirement could be met and your doubt could be solved by what doc has described and Karl's explanation.
The one thing that may confuse us would be that why Contact -> Account (Account) relationship exists in OOB drop down list, while I didn't find Account field in account entity.
Regards,
Clofly
I think you might be using the wrong relation. Try using Contact -> Account (Company Name) instead of Contact -> Account (Account) for both of your segments. I suspect the bottom group from your "working" segment is also not finding any contacts, but the segment still shows results because you are using UNION and the top group is finding at least some contacts.
The Contact -> Account (Company Name) relationship tells you that the relation between the Account entity and the Contact entity goes through the Company Name field of the Contact entity. The Company Name field holds the name of the company (account) that each contact works for, so this query will find employees of the accounts you have defined. If you are actually looking for the primary contact for each account (as defined on the account record), then use Account -> Contact (Primary Contact).
I'm not sure what Contact -> Account (Account) is for. For me, it never finds anything.
André Arnaud de Cal...
291,969
Super User 2025 Season 1
Martin Dráb
230,842
Most Valuable Professional
nmaenpaa
101,156