Repeated results in filters - cascading dropdown

Barcellos

Ana Barcellos
Hello, guys! I have a problem with filters for more than a week and I wish somebody could help me with this question: how could I avoid repetead results in filters of cascading dropdown elements?


I have a form called "Activities" wich has the following items between its elements:

*Unit's number
*Unit's name
*Unit's city
*Unit's state

If I use a database join for each element, it works fine.
In this case, I would have 4 other tables to join with (number, name, city and state) - the biggest table has 6 thousand rows.
Here the user should select each element.

However I want the user to select just the first element (unit's number) and the other 3 elements would be completed automatically.
So, in this other case, I have a table called "Units" wich has this 4 elements - number, name, city and state. Again I'm working with 6 thousand rows.

On my form "Activities", the first element (unit's number) is a database join to the field "Number" on "Units" table. The 3 other elements are using the plugin cascading dropdown and the same "Units" table, watching the first one (Unit's number).

It works very well on the form. When the user selects the unit's number, the unit's "name", "city" and "state" are automatically filled (I'm using radio for that).

The problem is: it doesn't work on the filter's list when the element uses cascading dropdown plugin.
It shows repeated results! o_O

For example:

number - name - city - state
001 - Unit Brasilia - Brasilia - DF
002 - Unit Brasilia 2 - Brasilia - DF
003 - Unit Brasilia 3 - Brasilia - DF
004 - Unit S?o Paulo 1 - S?o Paulo - SP
005 - Unit Rio de Janeiro 1 - Rio de Janeiro - RJ


The first element filter - number, a database join - works perfectly. It doesn't matter how many users select the "001", it will appear only one "001" to select on my filter.

But it's different when I use the cascading dropdown.
If I have 4 users and one of them selects "001" in "Unit's number", the other "002", the other "003" and the other "004", my city's filter will show Brasilia repeated 3 times!!

Can anyone help me with that? Please... :confused:
 
It would be easy if I had the option "Group by: value/label" on List View Settings > Filters
Since I don't have it, does someone know how could I do that?
 
Since we coudn't solve the problem above :confused: , we are trying another way. However, the problem with duplicated values persists.
We need to know know how to build joins in the list (fabrik) using multiple tables. We explain this case in this other post.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top