Forum Discussion

Don_Jackson's avatar
Don_Jackson
Ideator II
3 years ago

Query Definitions - Removing duplicate rows / returning a single relationship row

Hello all. I am adding more information to the 'BOM Structure' tgv query and could use some help in removing duplicate rows. Although I know various ways of handling this in SQL, I have not been able to arrive at a solution using where or join conditions in this Query Definition.

In this case, I want to display a link to the items CAD drawing viewable. The below query outputs the correct results (using a foreign CAD classification property) however there are occasions where the Part CAD relationship may have been been accidentally created twice. Ideally, I would only return the first row.

Here is a screenshot of the query definition:

Here is what the output looks like:

Any help is appreciated. Thank you

4 Replies

  • Hi,

    did you find a solution? I haven´t seen this one in my Innovator yet. The simplest reason would be, that the there are two references of the CAD file to the part (relationship + property item?). Another variant is maybe that all CAD versions are referenced, not just the latest one. Maybe you have multiple generations of these items?

    • Don_Jackson's avatar
      Don_Jackson
      Ideator II

      For us, this happens because someone has accidentally added a duplicate Part CAD relationship. We try to clean those up as we see them, but if the BOM Structure query happens to find a duplicate then we would always prefer that only one is returned. I have not yet found a solution.

      • taozai's avatar
        taozai
        Ideator II

        Hello,relationship item has grid event "onInsettRow",you could filter repeat relationship in this event.