Count with a criteria


I have a list of lists created and i need to insert an element that counts the number of times the same item appears in the list in index 3. I tried to do a sort, because i think it’s the easiest way but when i do it i have problems with the index. Help !



Set counter variable to 0
For each item in list (index 3)
If item = “criteria” then
Add 1 to counter

1 Like

Hello Tim, and Thank you

I’m sorry my title maybe is not the best. I dont have a legend or a text box that i say what i want to count.

I was trying to acomplish is for each element added to the list how many times the element in index 3 repeats and add a “column” with this count or sum.
That’s why i talked about the sort, so i can compare the current item to the previous.
This list is small, but it will be longer, so i can’t set up a legend for each element.

Any suggestion


Do you mean like this?

select_where_equijoin.aia (9.0 KB)

1 Like

Another approach:

countLists.aia (6.0 KB)

1 Like

Alternatively, set up a dictionary (empty) with the tags being country names, and their values being the count encountered so far in your traversal of the table, 0 if not found.
Add 1 to the count for that country each time you encounter it in the for each loop.

1 Like

Hello Tim!

Done ! Ty ty ty 5*****


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

please show me the blocks
i need to do it

The answer is above.

In future please create a topic on the community, instead of sending a private message.