Dateview: Count number of inline key field


I have an sample text with the key field “time” as follows:

I have tried at (time:: 2pm) at the (location:: desk) then I tried at (time:: 5pm) in (location:: library). At (time:: 6am) I tried a again.

I want to create a dataview table counting how many the key “time” appear in this note. Please help! I expected the result to be like this:

Category Frequency
time 3
location 2

Thank you!

Something like


Is it a fixed set of inline fields you want to count, or could it vary, and you want a dynamic setup? The latter is a lot harder…