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

18 Nov, 2024 11:24 PM
18 Nov, 2024 09:01 PM
07 Nov, 2024 10:53 AM
02 Nov, 2024 11:22 AM
01 Nov, 2024 12:41 AM

 

01 Oct, 2024 07:59 AM
30 Sep, 2024 11:37 PM
30 Sep, 2024 11:11 AM
30 Sep, 2024 02:37 AM
28 Sep, 2024 10:33 AM
26 Sep, 2024 06:41 AM