Since Winter 18, an exciting new feature has hit the tables, which makes it so easy, to deal with loops while working in visual flows.
After a fast lookup,the record count can be easily fetched in a sobject collection variable and assigned to a number variable. Play around with the number variable directly.
So finding out the number of open/closed/in progress opportunities gets more easy. Even you dont need to loop through the record set to get the count of records. You already have it before hand.
All you simply need to do is like:
- Perform a fast lookup with your required filters
Assign the record count to a sObject collections variable. (in screenshot: nofCases)
Use a Assignment step, to assign the variable to a number variable. (Point to note: the assignment variable should be of type number only to make use of equals count operator. In the screenshot, this is called testCount)
Voila! Now play around with the assigned variable :)