Jump to content
UBot Underground

I Need Help With Counting Duplicates In A List


Recommended Posts

I have a list that looks like this

 

June 16, 2014

June 16, 2014

June 16, 2014

June 17, 2014

June 17, 2014

June 18, 2014

June 18, 2014

June 18, 2014

June 18, 2014

June 19, 2014

June 19, 2014

June 19, 2014

June 19, 2014

June 19, 2014

 

and I want to be able to count each one of the dates

like

 

June 16, 2014 = 3

June 17, 2014 = 2

June 18, 2014 = 4

June 19, 2014 = 5

 

I just need to count how many dates

Link to post
Share on other sites


add list to list(%List,$list from text("June 16, 2014
June 16, 2014
June 16, 2014
June 17, 2014
June 17, 2014
June 18, 2014
June 18, 2014
June 18, 2014
June 18, 2014
June 19, 2014
June 19, 2014
June 19, 2014
June 19, 2014
June 19, 2014",$new line),"Delete","Global")
alert(%List)

 

Link to post
Share on other sites

clear all data
add list to list(%MyList,$list from text("June 16, 2014
June 16, 2014
June 16, 2014
June 17, 2014
June 17, 2014
June 18, 2014
June 18, 2014
June 18, 2014
June 18, 2014
June 19, 2014
June 19, 2014
June 19, 2014
June 19, 2014
June 19, 2014",$new line),"Don\'t Delete","Global")
set(#TempVar,"","Global")
set(#Count,0,"Global")
set list position(%MyList,0)
loop($list total(%MyList)) {
set(#Var,$next list item(%MyList),"Global")
if($both($comparison(#Var,"!=",#TempVar),$comparison($list position(%MyList),"!= Does not equal",1))) {
then {
add item to list(%Report,"{#TempVar} : {#Count}","Don\'t Delete","Global")
set(#Count,0,"Global")
}
else if($comparison($list position(%MyList),">= Greater than or equal to",$list total(%MyList))) {
increment(#Count)
add item to list(%Report,"{#TempVar} : {#Count}","Don\'t Delete","Global")
}
else {
}
}
increment(#Count)
set(#TempVar,#Var,"Global")
}
alert(%Report)

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...