Easy to Create, Easy to Change - Easy to use!

Support::

count



Parameters


Returns/Result


Examples


Reference

count

Type

Conditional Statistical Operator

Purpose

The count operator counts the number of records in the table being processed. It can also be used to count the number of times a condition specified by a comparison of two values is true. The result usually appears as a statistic in the summary area at the end of a report or group.

Syntax

CONDITION : count [other statistical operators];|.

Usage

To count all the records that meet a specified condition, enter :count after the condition as shown in Example 1. . When applied to a field, it counts how many times that field has a value. To count all the records processed by a script, use a statement that is true for every record, such as "A" = "A". This method is shown in Example 2.

Example 1

for MEMBERS with STATE = "NJ" ;

list records

LAST NAME in order ;

TOTAL DUE ;

TOTAL DUE > 40 : count .

end

 

This script tells DataEase: (1) List the MEMBERS records showing each member's LAST NAME and TOTAL DUE, and (2) count the number of members who have an TOTAL DUE greater than $40. The output from this script might look as follows:

 

 

Last Name

Total Due

Beauchamp

35.00

Carley

50.00

Fairchild

50.00

Giovanelli

70.00

Morrison

100.00

Parker

105.00

Count (> 40): 5

 

Example 2

for MEMBERS with STATE = "NJ" and TOTAL DUE > 40 ;

list records

LAST NAME in order ;

TOTAL DUE ;

"A" = "A" : count .

end

 

Example 2 produces output identical to Example 1, except that Beauchamp is omitted because her TOTAL DUE is less than $40. The count statistic is again 5, but in this case it represents all the records that are processed (because all records processed satisfy the count condition).

See Also


On the forum about count

spell date and number in all countries

[@EOF@]...

Product: Dataease [{8}]FIVE. Written by alembagheri tahmas 01/01/14 at 13:45:01

count of not updated in a while loop

Hi there,I have this simple algorithm to implement:1. Check how many working days there are between date x and date x - y days (y = 3);NOTE: I have a special table listing all days till 2050: the day has...

Product: Dataease [{8}]FIVE. Written by George Washington 16/10/15 at 07:08:04

Re:count of not updated in a while loop

Downalod Sample! This is one of the 20 least well known "bugs" in DataEase, but it is KNOWN ;-) There has been much debate on this as...

Product: Dataease [{8}]FIVE. Written by DataEase 16/10/15 at 12:07:02

Re:Re:count of not updated in a while loop

Thanks that works!...

Product: Dataease [{8}]FIVE. Written by George Washington 16/10/15 at 14:36:15

how to count second in execute function/derivation

Setlabeltext("timer",current time)+wait(0.01)+LabelExecDQL("update opening","","","","")+LabelExecDQL("post meter reading1","","","","")+LabelExecDQL("post meter reading2","","","","")+LabelExecDQL("post meter reading3","",...

Product: Dataease [{8}]FIVE. Written by Mohd Sedik Zakaria 09/12/15 at 06:22:13

Re:how to count second in execute function/derivation

Hello Mohd.I guess you could have picked a simpler derivation to do the "test" on ;-)Without seeing the entire "Image" here, I can only surmise that what you want is to figure out how long the process took.The easiest way is si...

Product: Dataease [{8}]FIVE. Written by DataEase 09/12/15 at 08:09:22

Calculate Discount Fields

DataEease for windowsVersion LegEasy 6.53Build 3158I am returning to an old program written many years ago and trying to add a Definition to a filed.What I am trying to do is something like below :if ( "rStockE...

Product: LegEasy 6 Windows. Written by Handles 20/11/18 at 13:16:26

Re:Calculate Discount Fields

These things need to be right or it won't save so without knowing the structure we can only have a go and try to explain.if ( "rStockEntryForm_ON" = "Proforma" SellingCost lookup "rOHeader_ON" "CompanyDiscount" + ?ExtraDiscount? , blank )<...

Product: LegEasy 6 Windows. Written by DataEase 22/11/18 at 20:09:24

Re:Re:Calculate Discount Fields

First may I say thanks you for the explanation , and help with this situation.Over the last few days I have tried different ways of doing the calculations without any success, I went back and have tried your suggestion But without any jo...

Product: LegEasy 6 Windows. Written by Handles 23/11/18 at 13:05:39

Re:Re:Re:Calculate Discount Fields

Sorry Regards the above JPG&nbsp; It's the If( part of the statement that's not working, the lookup rMaterials is working fine &nbsp;&nbsp;...

Product: LegEasy 6 Windows. Written by Handles 23/11/18 at 13:11:48

Re:Re:Re:Re:Calculate Discount Fields

Just thought I would add another jpg that may help&nbsp;...

Product: LegEasy 6 Windows. Written by Handles 23/11/18 at 16:59:02

Re:Re:Re:Re:Re:Calculate Discount Fields

the most obvious fault is that you don't format it properly.you have to have the , (comma) in the right places.if (A=B, Yes, No)you aveif (a=b yes,NO)&nbsp;That won't work.You can nest as many times as you...

Product: LegEasy 6 Windows. Written by DataEase 23/11/18 at 19:18:23

Re:Re:Re:Re:Re:Re:Calculate Discount Fields

thank you , that comma done the trick ,how I&nbsp;missed that I don’t know.&nbsp;Thanks again&nbsp;...

Product: LegEasy 6 Windows. Written by Handles 23/11/18 at 23:26:48

if( Status = "Proforma", lookup "rMaterialsMC" "SellingCost" – DiscountCalc ,

Amazing solve one challenge , and find another .Thanks for your help with this matter last week, by getting what I wanted with the if (“Proforma” If (“Sales Order” do this, Its thrown up a separate problem that you can’t seem override th...

Product: LegEasy 6 Windows. Written by Handles 30/11/18 at 11:14:19

How do I do a count of the number of yes's in yes/no fields

[@EOF@]...

Product: LegEasy DOS. Written by Simon Lazarus 01/05/20 at 13:13:05

Re:How do I do a count of the number of yes's in yes/no fields

Depends a little where you want to count it.You use a relationship.in DQL you can doretval :=&nbsp;Count of MyTable with FieldX=Yes .If you are to do this in a virtual field you need to define a relationship it can be be...

Product: LegEasy DOS. Written by DataEase 01/05/20 at 13:22:09

Re:Re:How do I do a count of the number of yes's in yes/no fields

Thanks for the prompt response.This works fine for a virtual field when I have added the support field to the relationship.I am trying to compile responses from surveys and have 20 different fields i need to have individual yes totals on...

Product: LegEasy DOS. Written by Simon Lazarus 01/05/20 at 13:38:55

Re:Re:Re:How do I do a count of the number of yes's in yes/no fields

Then you need 20 relationships if you are doing this in the form.The support field can be used in all the relationships and then the other side is the individual fields.You obviously have to use alternate relationship names....

Product: LegEasy DOS. Written by DataEase 01/05/20 at 17:20:18

Re:Re:Re:Re:How do I do a count of the number of yes's in yes/no fields

Alternative relationship names works great - Thanks...

Product: LegEasy DOS. Written by Simon Lazarus 04/05/20 at 13:07:53

Re:Re:Re:Re:Re:How do I do a count of the number of yes's in yes/no fields

20 relationships is 'ugly' and the counting can be slow if you have a lot of records...I would create a hidden integer field with a derivation of 'if( fieldname01 = 'yes', 1 , 0 ) for each of the 20 fields.Then just do a 'sum of tablenam...

Product: LegEasy DOS. Written by Earl Wertheimer 05/05/20 at 20:29:59

DataEase Account list of machines signed on blank

Once i have sign into the DataEase website and go to Account.&nbsp; My computers running DataeEase 8.5&nbsp; are not showing. Please help in a panic because should we need to change hardware our number of licenses will be used up...

Product: Dataease [{8}]FIVE. Written by BLESSED SHUMBA 30/05/22 at 06:59:36

Re:DataEase Account list of machines signed on blank

Hi BlessedNo reason to panic.it is a temporary problem due to SSL.&nbsp;if you access your account with http:// instead of https:// you will see your account.We are updating our website so it will soon be fixed....

Product: Dataease [{8}]FIVE. Written by DataEase 30/05/22 at 12:06:13

Re:Re:DataEase Account list of machines signed on blank

This has now all been fixed. Sorry for the inconvenience....

Product: Dataease [{8}]FIVE. Written by DataEase 13/06/22 at 09:10:44

Status bar record count vs percentage

In DE6 the current record number and total table&nbsp;record count is shown in the status bar on forms.in DE8 it gives a percentage instead of current record number.Is there a setting to change the default to record number?...

Product: . Written by Sam Bird 26/09/22 at 11:18:53

Re:Status bar record count vs percentage

No. No setting for this.&nbsp;...

Product: . Written by DataEase 07/10/22 at 20:45:31

Listing records in groups with a count.

Hi all,&nbsp;Say I have a table called Cars with the fields Year, Make &amp; 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 y...

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

Re:Listing records in groups with a count.

for cars;list recordsyear in group with group totals ;cars : Count .Check script as done from memory :-)...

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

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

Thank you very much for your help.&nbsp;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.&nbsp;for Cars ; list records Year in groups...

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

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

<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUsAAADwCAYAAACJzUacAAAgAElEQVR4nO3dfVxUdaI/8M8AKlk+3HYBDdpCHbEQcvMJ86G6a1PTlgU3Xkq/vSXsTgaVD7W/m5jIKhbVr9XsQcvZBde7v8zlt2iWTI6+bg9q4FMqyK44KnWDEtjbqpWiOHx/f5w5M+fMA3MGhhmCz/v18qUz58w533MGPn6fzjk...

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

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 .<img src="data:image/png;base64,iVBO...

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

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&nbsp; you can simply do&nbsp;for Cars;list recordsYear in groups ;Year :...

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

On the blog about count