Category / Section
How do I treat duplicate values in Combo Box and List Box widgets?
Published:
You may find duplicate values in the Combo box and List box widgets in the following scenarios.
- Scenario #1: Binding widget with unique id column in Value section and a non-unique foreign key column having same value tied with multiple unique ids logically, added in the Display Column section.
Example: Let's take the Northwind database. In Orders table, you may find OrderID as primary key column (unique) and CustomerID as foreign key column. When binding these columns in the corresponding sections of Combo Box widget as mentioned above, you may get the duplicate values like below.Combo box showing duplicate Customer IDs
This behavior is appropriate. Because, the table that you bounded has multiple orders associated with one customer. As per your data configuration in Combo Box, each duplicate entry (customer id) above corresponds to one unique order id. - Scenario #2: Inconsistent formatting of values in source.
Example: Consider a column with some duplicate values that just differs in terms of formatting like leading/trailing spaces, special characters included, etc. that are unnecessary. When you bind this data to the widgets, it will display like below.Data and how its displayed on widgetsThis is inappropriate. We should have the data cleaned and formatted before we make use of it for analytics. Then only, we can see appropriate results in the visualization tool. Hence, ensure your data satisfies the below condition.
- Identify the inconsistencies in the values, such as extra spaces or missing spaces between the words, unwanted characters, and remove them and make sure, the values are same.
Once changes made, you can view the distinct values in Combo Box and in List Box widgets.
Reference Links