Counting unique values in a list

mark's Avatar

mark

30 Jan, 2014 03:16 PM

Hi guys,

Picked up Nodebox again after a 2 year intermezzo. Been working my way through the tutorials (which is going well).
But, please, help me out with this:

How am I able to count every unique value within a list?

I have two lists. They both consist out of years (see attachment). I'm trying to connect the values of both lists through a line. It can only work when I'm able to count the unique values, I think.

Thanks in advance!
Mark

  1. Support Staff 1 Posted by Frederik De Ble... on 30 Jan, 2014 04:43 PM

    Frederik De Bleser's Avatar

    You could try a distinct node, which filters out all double values, and
    then add a count node afterwards.

    F

    On Thu, Jan 30, 2014, at 16:18, Mark wrote:

  2. 2 Posted by mark on 30 Jan, 2014 10:53 PM

    mark's Avatar

    Hi Frederik,

    Sorry, I guess I have to refrase myself.
    I want to count the amount of appearances of one value inside a list. The amount of appearances of every - what I called - "unique" value.

    Is it possible?

    Thanx again.
    Mark

  3. Support Staff 3 Posted by Frederik De Ble... on 04 Feb, 2014 09:33 AM

    Frederik De Bleser's Avatar

    The easiest way to do this is using a custom node, which I've attached here, that counts the distinct elements.

    Best,

    F

  4. mark closed this discussion on 05 Feb, 2014 03:03 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

22 Feb, 2024 05:51 AM
22 Feb, 2024 01:11 AM
21 Feb, 2024 05:27 PM
21 Feb, 2024 04:49 PM
16 Feb, 2024 05:24 PM

 

06 Feb, 2024 04:45 AM
19 Jan, 2024 09:50 AM
13 Jan, 2024 03:47 AM
05 Jan, 2024 05:10 PM
05 Jan, 2024 04:54 PM
04 Jan, 2024 11:49 PM