Skip to Content Skip to Menu

How can I remove duplicates from a list?

  • konp
  • konp
  • OFFLINE
  • Posts: 18
  • Thanks: 0
  • Karma: 0
9 years 1 month ago #271709 by konp
Hi

I hope I'm in the right place. Anyway I have added the field 'branch' to the user profile and created a list of branches using list manager.

Each branch has many members so when I list the branches I get repeats of the same branch. Is it possible to remove the duplicates? SQL 'distinct' would do it but the advanced filter only takes the 'where' part of and SQL statement.

If someone can help I'd be very grateful. Thanks in advance.

Please Log in or Create an account to join the conversation.

  • nant
  • nant
  • OFFLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
9 years 1 month ago #271730 by nant
Replied by nant on topic How can I remove duplicates from a list?

konp wrote: Hi

I hope I'm in the right place. Anyway I have added the field 'branch' to the user profile and created a list of branches using list manager.

Each branch has many members so when I list the branches I get repeats of the same branch. Is it possible to remove the duplicates? SQL 'distinct' would do it but the advanced filter only takes the 'where' part of and SQL statement.

If someone can help I'd be very grateful. Thanks in advance.


The user list functionality is used to list users.
What duplicates are you talking about?

Please Log in or Create an account to join the conversation.

  • konp
  • konp
  • OFFLINE
  • Posts: 18
  • Thanks: 0
  • Karma: 0
9 years 3 weeks ago #272138 by konp
Replied by konp on topic How can I remove duplicates from a list?
Right. Well I'm not using it for that. Each user has added to their profile a field called 'branch'. I don't think it's possible to normalise the data in CB otherwise I'd have branches as a separate entity and use a link to connect users to one branch.

As it is I've got a branch field in users, but I need to list all the branches. What I have done is list all the users, but only show the branch field. If there are, say, three users in the same branch then the branch name appears three times. I only want it to appear once.

I hope this makes sense. Perhaps there's another way of listing the branches?

Thanks in advance for any reply and thanks for help to date.

Please Log in or Create an account to join the conversation.

  • nant
  • nant
  • OFFLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
9 years 3 weeks ago #272244 by nant
Replied by nant on topic How can I remove duplicates from a list?

konp wrote: Right. Well I'm not using it for that. Each user has added to their profile a field called 'branch'. I don't think it's possible to normalise the data in CB otherwise I'd have branches as a separate entity and use a link to connect users to one branch.

As it is I've got a branch field in users, but I need to list all the branches. What I have done is list all the users, but only show the branch field. If there are, say, three users in the same branch then the branch name appears three times. I only want it to appear once.

I hope this makes sense. Perhaps there's another way of listing the branches?

Thanks in advance for any reply and thanks for help to date.


No way to do what you are wanting with CB User lists.

You would need to develop something else to do this.

Please Log in or Create an account to join the conversation.

  • konp
  • konp
  • OFFLINE
  • Posts: 18
  • Thanks: 0
  • Karma: 0
8 years 11 months ago #273782 by konp
Replied by konp on topic How can I remove duplicates from a list?
Hi

Re: the above query; ie how to I show a list of groups: I've just watched your new tutorial on GJ3 and this shows how to list groups or categories. Problem solved. It's an option in the plugin menu.

I don't know if this is the place to make suggestions, and I have to 'fess up to being a complete novice, so my suggestion may either have been implemented or be rubbish, but with these caveats, here goes:

I am trying to model a structure that has a head office and branches. Each branch has a chair, a treasurer, a secretary and a communications officer. I would like to display the officers (as just described) when you drill down from the list of groups and only list 'other members' on drilling down further.

It would be very useful to be able to attach fields to the group. Eg 'chair' 'treasure' etc. It would be great to be able to link members to these fields.

Is this a feature that you would consider? Is it something others would find useful? I feel sure that other applications would be able to use user created fields (a bit like adding fields to profiles) added to a group.

I hope this is helpful.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum