Live filtering of duplicate data grid entries

Christopher Davies shared this question 5 years ago
Answered

I'm wondering how best to go about removing duplicate/triplicate entries from a data grid. Here's a simplified example:


If I have a data master like so: 6f5bc87292221d39e4f526a387dc5b9f


and it is populated thus:


If I create an OnPageLoad event for Row1 that displays the sum of the values of all items 'Red' (to give 4 + 5 + 6 = 15)


upon simulation it gives this:


I understand why this happens - the calculation is repeated for each entry as the page loads. However, I'd like to suppress the duplicate calculations in the data grid without deleting the values from the data master. I've thought about using a duplicate flag attribute and a filter placed before the other event, but can't manage to get this to work. I'd be grateful for any suggestions

Comments (3)

photo
1

Let me do some research then I will get back to you.

photo
1

Hi Christopher,


First of all, you can use the info from a datamaster anywhere (label, text table, data grid, etc.)


In your case, you can do the following steps:


1. Create your data master


b83dd846beb7743112b1fb83a6c9122b


2. Add a text table into your canvas.


3. Now, create an "on page load" event, with "set value" action. Look the following image of how to calculate it.


4. For another color, just copy and paste the action and modify the value.


I hope it helps you.

photo
1

Thanks Albert, unfortunately the actual prototype I'm working on is a bit more complex so I couldn't use a table solution. Thankfully I managed to figure it out though. I added 2 additional attributes to the data master - a 'key' unique to each entry in the data master (made by concatenation of other attributes), and a 'flag' attribute.


Because I was trying to remove visual duplicates, it didn't matter which of them were not shown. I created an onpageload event to add a value of 1 to the flag attribute of those rows which did not contain the maximum value of the key attribute. Then I filtered to show only those rows which didn't have the flag = 1 attribute (i.e. the row with the maximum value of the key). This is working fine and I've managed to implement it in the main prototype now :)