cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

How Do I Count the Total Number of Similar Values in a Column?

Jump to solution

So I need a site workflow to query a list and make a count of column values which are similar. In the example below, there would be 4 instances of 26 and 3 instances of 27. I can then go on and do other things with those numbers. How should this be done?

My ID

26

26

26

26

27

27

27

Labels: (1)
Tags (2)
Reply
2 Replies
Workflow Hero

Re: How Do I Count the Total Number of Similar Values in a Column?

Jump to solution

For a NW 2013 workflow I would use the following approach:

  • WF variables:
    • colMyIDs
    • colMyIDsCount
    • colItemIDs
    • numIndex
  • WF actions:
    • Get MyIDS in collection colMyIDs
    • Remove duplicates with a Collection Operation action
    • Use a For each to loop through each MyID
      • Get current MyID's index and store in numIndex
      • quey list for all item ids with MyID = current MyID from colMyIDs and store in colItemIDs
      • Count items in collection colItemIDs
      • Add count value to colMyIDsCount using numIndex

Hopefully this is sufficient to get you going.

Reply
Workflow Hero

Re: How Do I Count the Total Number of Similar Values in a Column?

Jump to solution

Thank you. Removing duplicates was also what I was thinking earlier so your post confirms it. Here it is in action:

Reply