3 Replies Latest reply on Mar 10, 2018 1:31 PM by phoffmann

    Query Based Scope returns duplicate results

    carlos Expert

      EPM 2017.3

      I found this: Scope returns duplicate results

      However my scope is based on a query, the query itself looks fine (no duplicates) but the scope show 1 device multiple times.

      I tried changing the columns but still the same no matter which column set I use.

       

      Any ideas?

      Best.

        • 1. Re: Query Based Scope returns duplicate results
          phoffmann SupportEmployee

          Add the "Device ID" column ... that's an easy way to verify / guarantee that "it's the same device".

           

          Chances are it's still a case of "multiple lines of data" coming from SQL being reflected in the console.

           

          If you INSPECT (rightclick - inspect) the QUERY, you can copy the QUERY SQL and throw that at Enterprise Manager ... see if you get multiple entries there too.

           

          If yes ... you've got multiple results in a column somewhere

           

          If no ... that'd be (against expectations) a bug. And we'd need to get a (full) backup of the DB ++ details of that query to hunt that down.

           

          But ... usually (more often than not), it'll be a multi-data value causing you to get multiple lines back.

           

          If you want "pretty much guaranteed" single-data values, try this column set:

          • Device ID (for guaranteed uniqueness checking)
          • Device Name
          • Operating System Name

           

          ... that's it. (the KISS principle).

           

          Then add 1 column at a time, 'til you see what's causing you your multiple values.

          1 of 1 people found this helpful
          • 2. Re: Query Based Scope returns duplicate results
            carlos Expert

            Hmmm, so this is what I found:

            1. You can not change the column set of a scope, the column set of a scope is whatever the DEFAULT column set is for the core.

            To fix the issue, change the default column set, this will fix the view on the scope results. Note that we can still change the column sets used in queries and other views as desired, but don't change the default unless you are sure they won't create duplicates.

            With this info, I changed the default Column set to a Basic Column set as recommended above (Device ID (for guaranteed uniqueness checking), Device Name, Operating System Name) and DISPLAY NAME that can not be removed. Using this the scope got me good results, no duplicates.

            CONCLUSION:

            The way the scope gets/display its data is not the same as for the query, (even when the scope is based on a query) I do not know why.

            Duplicate values are (as far as I have found and described by phoffmann) the result of duplicate searched values, either in the underlying query or based column set.

             

            Thanks for the additional recommendations, sometimes we need to take a step back and re evaluate.

            Best.

            • 3. Re: Query Based Scope returns duplicate results
              phoffmann SupportEmployee

              Ah - you've said nothing about scopes .

               

              But OK - as long as you're ahead of where you were, that's what matters.