Simplicty and flexibility!


Listing records in groups with a count.


Started by Bolt-on-Trailers
Search
You will need to Sign In to be able to add or comment on the forum!

Listing records in groups with a count.

Hi all, 

Say I have a table called Cars with the fields Year, Make & Model. How do I count the number of records when listing the Year field in groups? The script below gives me the year in groups but say there are 25 records with the year 2020, 15 records with the year 2021, 10 records with the year 2022 and so on. Is there a way to add another field in the script that counts the number of records after listing the Year field in groups?

for Cars;

list records

Year in groups.


Written by Bolt-on-Trailers 30/06/23 at 19:48:52 Dataease [{8}]FIVE

Re:Listing records in groups with a count.

for cars

;

list records

year in group with group totals ;

cars : Count .

Check script as done from memory :-)


Written by Josef Vella 05/07/23 at 13:59:03 Dataease [{8}]FIVE

Re:Re:Listing records in groups with a count.

Thank you very much for your help. If I use the following script I get the attached error. If I remove the "Cars : Count ." of the script it lists the year in groups but no totals. 

for Cars ;

list records

Year in groups with group-totals .

Cars : Count .


Written by Bolt-on-Trailers 05/07/23 at 15:54:01 Dataease [{8}]FIVE

Re:Re:Re:Listing records in groups with a count.

You have managed to change Josef's script so it doesn't work.

; is the termination character if there is more to follow . is for the last item.

List records

Item1 ;
Item2 ;
ItemN ;
LastItem .


Written by DataEase 06/07/23 at 09:38:56 Dataease [{8}]FIVE

Re:Re:Re:Re:Listing records in groups with a count.

OK, but the following has this error when I try to save. What needs to change in the last line of the script?

for Cars ;

list records

Year in groups with group-totals ;

Cars : Count .


Written by Bolt-on-Trailers 06/07/23 at 15:14:09 Dataease [{8}]FIVE

Re:Re:Re:Re:Re:Listing records in groups with a count.

The problem is that you have no field called Cars in the table.

I guess you have one called Make.

If you simply want the count of the year  you can simply do 

for Cars;

list records

Year in groups ;
Year : Count .


Written by DataEase 07/07/23 at 19:08:23 Dataease [{8}]FIVE
DG3_ForumList