Counting Number of Entries by Dropdown Values

Trying to count or total the number of entries where a specific dropdown value has been selected. In this case, form has a dropdown of US states and I’d like to be able to show the total number of entries for each state. e.g. CA 5, FL 4, TX 10, etc…

What’s the best approach to do this programmatically either within GF or Gravity View?

Hello. You can do this with the Gravity View Math add-on, with the gvmath shortcode:

You can also use GravityWP – Count – WordPress plugin | WordPress.org, which is a free plugin from GravityWP.com

2 Likes

That was my first guess too, but turns out Gravity View support confirms that their Math add-on doesn’t handle counting - or at least not yet - it may be something they’re looking to add in future versions.

Hi Erik, explored that too and believe it counts number fields only. In my case, I’d want to be able to count dropdown selections.

That is possible with GravityWP Count, like this:

[gravitywp_count formid="2" filter_field="3" filter_value="dropdownvalue"]
2 Likes

Thanks! I’ll try that!

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