How can I remove duplicates from a list?

8 years 6 months 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 to join the conversation.

8 years 6 months 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 to join the conversation.

8 years 6 months 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 to join the conversation.

8 years 6 months 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 to join the conversation.

8 years 5 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 to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.206 seconds

Facebook Twitter LinkedIn