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

On the blog about count