Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Find unique elements for a given column in a table model
QtWS25 Last Chance

Find unique elements for a given column in a table model

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 223 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lolo67
    wrote on last edited by
    #1

    I need to find each unique combination in a table

    Suppose I have a table that looks like this

    Column1 Column2 Column3
    A C F
    A C F
    A D F
    B C F
    B C G
    B D F
    B D G
    B E F

    (1) I need to understand that Column1 is composed by two different elements A and B
    (2) Then for each element found in column1 I need to filter the table - the result will be two tables

     Column1  Column2  Column3
       A       C       F
       A       C       F
       A       D       F
     
     Column1  Column2  Column3
       B       C       F
       B       C       G
       B       D       F
       B       D       G 
       B       E       F
     
    Then for each table do the same with Column2
    
    Column1  Column2  Column3
       A       C       F
       A       C       F
       
    Column1  Column2  Column3   
       A       D       F
    
      ... and so one with each Column on the table
    

    I suppose thar the filtering of the table can easily be done via QSortFilterProxyModel

    However I am not sure what to use to perform operation (1) i.e. to understand for a given column how many different elements the cloumn is composed by..... Maybe someone will have a clever idea to solve this.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved