Group data by field on view

By: Massimiliano Mollo | Asked: 07/24/2022
ForumsCategory: General questionsGroup data by field on view
Massimiliano Mollo asked 2 years ago
Hi I have a form with many records, for example : NAME=BOB ORANGE=1 NAME=BOB APPLE=1 NAME=PETER ORANGE=2 NAME=PETER APPLE=2 i need a view group by name, in this way: NAME.       ORANGE.      APPLE BOB.              1.                   1 PETER.          2.                   2   TKS
2 Answers
Bobby Clapp answered 2 years ago
The view has sort and filter features where you can sort or search by fields as you so choose. https://formidableforms.com/knowledgebase/display-your-form-data/#kb-order
Massimiliano Mollo replied 2 years ago

Unfortunately not help, always repeat the name for every record saved

Bobby Clapp replied 2 years ago

I see. Had to re-read that. I don't know if anyone might have a better solution, but you might have to build that layout manually and then use the appropriate stat shortcode (total or count probably) to get your values -> https://formidableforms.com/knowledgebase/add-field-totals-and-statistics/#kb-conditional-stats

Possible example -> [frm-stats id=36 type=total 25="Bob"] (36 is the value field to be counted or totaled, 25 is the field that collects the name)

Massimiliano Mollo replied 2 years ago

[frm-stats id=36 type=total 25="Bob"] (36 is the value field to be counted or totaled, 25 is the field that collects the name)

The problem is Bob, I not whant insert manually, because the name change everytime,
I need if 25="[769]"(25 is the field of the form A, and 769 is the field of the form B.
I need if is the same, show me, but show me, only one time the name "Bob" and not if I have Bob on field 25, 50 times and 50 row, if I have 50 record Bob.
I hope you understand me, my English is bad 🙂

Chris Adams answered 2 years ago

You can probably use a mixture of Bobby's solution and the built in form filters.
In the view filter settings if you select 769 (Bob etc) as the field and then 'unique (get newest entries)' as the filter type it will return 1 row for each unique entry in the field (1 row per name).
In the row details you can then try a dynamic frm-stats shortcode like 

[frm-stats id=36 type=total 769="[769]"]

 That will give you the total for field 36 for each unique name in the table. 

Massimiliano Mollo replied 2 years ago

Tks Chris, but I not need unique total, but need unique name for each column

Chris Adams replied 2 years ago

Why a unique name for each column? A unique row for each name would make more sense.

Chris Adams replied 2 years ago

Something like this: https://www.fdmdigital.co.uk/development/test-page-5/

Massimiliano Mollo replied 2 years ago

Yes sorry unique row, for each name

Massimiliano Mollo replied 2 years ago

Yes same of your link

Chris Adams replied 2 years ago

<p>Ok so that was done with the method i explained earlier.</p><p>Build your table and then set the view filter to "unique (get newest entries)" on the name field. That will create 1 row for each unique name.</p><p>In the table content you can use shortcodes like this: [frm-stats id=816 type=count 816="[816]"] to count the number of entries (or total etc) for each field.</p><p>I've added a screenshot to the link i sent earlier with the view settings. This was done with an older version of Views but you can do the same thing in the new visual views.</p>

Massimiliano Mollo replied 2 years ago

ok @Chris Adams tks unique work,but now have other problem,i need to show the unique name,only if this name name are present on form B.
Example:
FORM A= field name BOB,PETER
FORM B=field name BOB,MIKE

on unique view show me only BOB with totals and soon by frm-stats

Chris Adams replied 2 years ago

If you need to filter Form A on entries in Form B you may have to write a custom function to do that.

You can also do it using URL parameters which may work for you. You can find out more about it here: https://formidableforms.com/knowledgebase/filtering-entries/#kb-by-parameter

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right