Jul 06, 2021 08:15 PM
Hello,
I have 3 rows like this…
companyA: US
companyB: CA
companyC: US, CA
But I want to be able to group by territory so that I see…
CA
companyB
companyC
US
companyA
companyC
Is that possible? I.e. to have single rows such as “companyC” appear in multiple groupings because of the multiple attributes it contains? If not, the problem is that I’d have to create 2 rows for companyC which is annoying if you want to apply a company-level comment to the row.
Thanks for any thoughts,
Daniel
Jul 06, 2021 09:09 PM
You would need to create a many-to-many relationship, and then do your grouping from the junction table. You can learn more about many-to-many relationships here:
Jul 06, 2021 11:24 PM
Thanks but then I’d still end up with multiple rows in the junction itself right? E.g. I’d have to see 2 rows like companyC-US and companyC-CA. I don’t have an issue with modelling a many-to-many mapping - it’s just a grouping/visualisation problem. I need a way to group by single/distinct countries so that in my example I only see 1 group for US and 1 group for CA (instead of also a group for US,CA)
Jul 07, 2021 05:12 AM
That is correct… in either your current table or a junction table, you will need more than one row per company.