Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

How do filters for segments work ?

(0) ShareShare
ReportReport
Posted on by

Hi each and everybody.

There'e something I can't figure out while using filters in Segments.

I'm using the Cronus example database in Navision and I'm focusing on the PERSONA Profile Questionnaire, which is supposed to be already applied to all the Contacts recorded and, when opened in its own Edit window, shows among other things that 96 contacts are women, 102 contacts have children and 9 contacts have Master/PhD.

Now I tried to add contacts to a Segment by filtering them exactly through those three requirements, that is that they are women, with children and a Master/Phd.

I would expect the contacts returned are 9 or less, instead they are 152.

Next thing I tried to delete the Lines (i.e. the returned contacts) together with the No. of Criteria Actions (i.e. the 'Where' clauses) and rebuild the filter (i.e. the query) all over again, first seeking only the contacts with children and fetching 102 of them, and that's Ok, then adding that the contacts must be women and retrieving 149, and that's not Ok no more as I'd expect 96 or less of them. But the crucial test is adding the condition by which the contacts must also be Master/PhD, getting again 152, when once more I was expecting 9 or less of them.

Why the heell is that ?

What am I missing here ? 

I guess the example Cronus db comes with any Navision license, so I encourage you to try and do what did, and then tell me what it is I don't understand, please.

As usual, many, many thanks in advance to all of you who will be able to enlighten me the way.

Hear from you many.

                                                    Raoul Bertorello

*This post is locked for comments

  • Verified answer
    Community Member Profile Picture
    on at
    RE: How do filters for segments work ?

    Hi everyone.

    So, here's how the 'Add Contacts' mechanism works, but first I start by saying that I'm not to repeat all the tests I made, I'll only quote those significant to clear the statement I'm going to make, then you can go ahead by doing all your own tests, just be sure you'll meet my results and further validate my statement. And another preface: the following conclusion valid for the 'Add Contacts' mechanism does not allow you to make a similar conclusion for the 'Reduce Contacts', a mechanism that I tested not to work as you would expect given how the 'Add Contacts' one works.

    Statement-Conclusion: 'Add Contacts' works like a UNION statement in the SQL standard language, that is it adds together the records from two or more different sets without including duplicate records: all the sets are merged together avoiding repetitions. Like in the UNION standard SQL statement, 'Add Contacts' adds together only consistent items like all contacts are: they all have the same attributes and data types (thay have a contact name, a company name if they are companies ... etc).

    But mind: what this UNION unites are not the results of SELECT queries, 'Add Contacts'/UNION unites just the total amounts of the answers in a Profile Questionnaire that we are going to add together by the 'Add ...' mechanism: these totals are not results of SELECT queries, yet they are treated as such and therefore it's convenient to our comprehension to think of them like that.

    The tests I quote to demonstrate the conclusion are made on the Cronus example db:

    If you open the PERSONA profile questionnaire you'll read there are 151 men, 96 women and 9, 3 women and 6 men who took a master or a PhD.

    Now if in a Segment you add, say, first the 'Hombre' together with the 'Master/ Doctor' (it's Spanish because I'm using a Spanish version of Navision, I guess it'll do something like men and Master/ Phd in English; there is really a space between the slash / and D of Doctor) as 'answer' in the 'Where' and 'And' of the Contact Profile Answer tab (you can avoid to use the Where to specify that the Profile Questionnaire Code has to be PERSONA, as well as you could need to add the 'Master/ Doctor' answer only on second act, that is after you added first the 'Hombre' answer, I didn't understand clearly how this works exactly, but it's of lesser importance now, just look at the No. of Criteria Actions in the Segment window and see if it writes 1 or 2, meaning that in a case it added only one answer, while in the other it added both) then you'll get 154 rows, because among the 9 M/PhD there are 6 men who are already present in the list of 151 'Hombre's so the 'Add Contacts' mechanism adds to 151 only 9-6=3 other items, the three women who took the M/PhD; addition without repetitions.

    Then you decide to add to this first result the list of 96 women, and here the 'Add Contacts' mechanism realizes that 3 women in the result of the first UNION are already present in the list of 96, so it adds only 96-3=93 to 154 which will add up to 247.

    You can change the order of the addendums to anything you may write, Mujer+Hombre+Master/ Doctor or Master/ Doctor+Hombre+Women or Women+Master/ Doctor+Hombre ... etc , and fortunately the total amount is always the same, 247.

    Now, as I brought it forward the 'Reduce Contacts' mechanism DOES NOT work like the MINUS statement in the SQL language, you can easily see it by reducing the 247 total amount by the 9 M/PhD holders and expecting to get 238, while you'll have 206 instead.

    The functionality of 'Reduce Contacts'is the goal of a next set of tests, and wasn't the purpose of my original question, which was really focused on the 'Add Contacts' feature only. So, please, have the patience to wait more days till I'll have the time to figure it out (maybe I'll never have the will besides the occasion, the time will tell, so I strongly invite you to investigate).

    In the meanwhile thank you all for your kind attention.

  • Community Member Profile Picture
    on at
    RE: How do filters for segments work ?

    Hi, Jonathan.

    Well, yeah, your suggestion meets the facts, which is also what I saw, that is that the filter works like a query as long as you use against the adding Contacts (the table) only one Criteria Action (the 'where' clause) like the one to have children, as per my example.

    Ok.

    But it sounds really weird that in a tool, Navision, so widely used in the world, that relies on an underlying common database, where all data like Contacts and whatsoever else is stored in common tables ... etc. , it sounds really weird that it doesn't work like everyone would expect when it comes to use what are supposed to be common SQL queries.

    And if it doesn't work in a case like this, and I'm sorry to stress this point: an example database and sw features chosen by no less than Microsoft, so again if it doesn't work in a case like this then I'll expect that all other figures, numbers, quantities, call them the most you like, returned by any feature in Navision are plain wrong.

    And not just wrong on an example level, but also wrong on a real world level based on data from manufacturing companies like the one I work for, where you would use Navision.

    So, if this is the case, then I'll better change the brand of the ERP software: because if the numbers returned by Navision are wrong, then also my predictions based on those numbers, and my future actions based on those predictions are wrong.

    Jonathan, I do really hope there is some more subtle mechanism working here.

    Don't get me wrong, Jonathan, your explanation looks as immediate and correct as it looked to me too, and I thank you a lot for it, but I can't honestly agree that in such a case there isn't some other kind of reason.

    So I pray you, and everyone else reading this post to elaborate something more, provided that imagination and sources of information help us all do so.

    Please, Jonathan and all others, revert to me anything else that could come to your mind.

    Deeply thank you again, and hear hopefully from you all and soon again.

                                                            Raoul Bertorello

  • Suggested answer
    keoma Profile Picture
    32,727 on at
    RE: How do filters for segments work ?

    that won't work. you can only filter by one set of "Profile Questionnaire Code" and "line no." for contact profile answers when adding contacts to a segment.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics NAV (Archived)

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans