Beta

Grouping distinct items

Description
Loading description...
Arrays
Fundamentals
  • Please sign in or sign up to leave a comment.
  • FArekkusu Avatar

    Duplicate, as pointed in the comment below.

  • JohanWiltink Avatar

    Duplicate of groupBy. Not word for word, but the concept isn't novel.

    Or is it different enough?

  • Unnamed Avatar

    So what's the idea?.. Now grouping by a given key works as well as grouping by id reset.

    • haroen Avatar

      This is an idea I had from something I did at work, I used the numbered id, a colleague used the key, so thought to leave both possibilities as an option to the reader here

  • ZED.CWT Avatar

    but each category will only occur once, there won't be repetitions afterwards.

     has the right amount of categories
     Log
    [{"_distinctSeqID":0,"name":"Mr. Vidal Tillman","parse":"SDD"},{"_distinctSeqID":1,"name":"Mr. Houston Orn, II","parse":"SDD"},{"_distinctSeqID":2,"name":"Mr. Candice Nolan","parse":"SDD"},{"_distinctSeqID":0,"name":"Mrs. Alec Lindgren","parse":"AGP","image":"http://lorempixel.com/640/480/cats"},{"_distinctSeqID":1,"name":"Miss Candido Ruecker, DDS","parse":"AGP","image":"http://lorempixel.com/640/480/cats"},{"_distinctSeqID":2,"name":"Mrs. Carole Lindgren, Jr.","parse":"AGP","image":"http://lorempixel.com/640/480/cats"},{"_distinctSeqID":0,"name":"Miss Margret Mills, DDS","parse":"ADP"},{"_distinctSeqID":1,"name":"Ms. Eli O'Reilly, II","parse":"ADP"},{"_distinctSeqID":2,"name":"Ms. Jacynthe Ward","parse":"ADP"},{"_distinctSeqID":0,"name":"Ms. Leonel Douglas, MD","parse":"ADP","image":"http://lorempixel.com/640/480/cats"},{"_distinctSeqID":1,"name":"Ms. Briana Willms","parse":"ADP","image":"http://lorempixel.com/640/480/cats"},{"_distinctSeqID":0,"name":"Mr. Hertha Moen, PhD","parse":"SSL"},{"_distinctSeqID":0,"name":"Ms. Kiera Larkin, MD","parse":"CSS","image":"http://lorempixel.com/640/480/cats"},{"_distinctSeqID":1,"name":"Miss Bertrand Ratke, Jr.","parse":"CSS","image":"http://lorempixel.com/640/480/cats"},{"_distinctSeqID":2,"name":"Miss Theo Terry","parse":"CSS","image":"http://lorempixel.com/640/480/cats"},{"_distinctSeqID":3,"name":"Ms. Chance Jacobs, II","parse":"CSS","image":"http://lorempixel.com/640/480/cats"},{"_distinctSeqID":4,"name":"Miss Amaya Monahan","parse":"CSS","image":"http://lorempixel.com/640/480/cats"},{"_distinctSeqID":0,"name":"Miss Asha Rempel, MD","parse":"SDD"},{"_distinctSeqID":1,"name":"Ms. Cecilia Goldner, DDS","parse":"SDD"},{"_distinctSeqID":2,"name":"Miss Hilario VonRueden, I","parse":"SDD"},{"_distinctSeqID":3,"name":"Dr. Junior Walsh","parse":"SDD"},{"_distinctSeqID":4,"name":"Mr. Cristobal McKenzie","parse":"SDD"},{"_distinctSeqID":0,"name":"Ms. Suzanne Batz","parse":"HDD","image":"http://lorempixel.com/640/480/cats"},{"_distinctSeqID":1,"name":"Mr. Arlie Konopelski, I","parse":"HDD","image":"http://lorempixel.com/640/480/cats"},{"_distinctSeqID":2,"name":"Ms. Derrick Breitenberg","parse":"HDD","image":"http://lorempixel.com/640/480/cats"},{"_distinctSeqID":0,"name":"Mrs. Meghan Gusikowski, IV","parse":"GB"},{"_distinctSeqID":1,"name":"Ms. Cedrick Gibson","parse":"GB"},{"_distinctSeqID":2,"name":"Miss Noemie Hintz, PhD","parse":"GB"},{"_distinctSeqID":0,"name":"Miss Violet Daugherty, Sr.","parse":"RSS","image":"http://lorempixel.com/640/480/cats"},{"_distinctSeqID":1,"name":"Ms. Thaddeus Rutherford, PhD","parse":"RSS","image":"http://lorempixel.com/640/480/cats"}] parse
    Expected: 10, instead got: 8