Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

count

Status
Not open for further replies.

htgls2000

Programmer
Oct 9, 2008
5
US
I am trying to get a count, i am looking at two dates and comparing them. If the assy was before the ship date then it is to print yes. Then I want to count the number of yes's.

Formula is called count yes:
if {BKARINVL_BBM.BKAR_INVL_ESD} > {WORKORD_BBM_1.MTWO_WIP_AFIN}
then "yes"
else "no"

I tried a running total on count yes with a evaluate w/a formula-- where {@count yes} = "yes" with no reset, but I get weird numbers
 
You need to show sample data that shows both fields you are comparing along with the field you are trying to count. Also show what count you expect to see. Are either of the fields in the formula ever null?

-LB
 
SHIPPED TRAILERS REPORT BY DEALER

ORDER ASSY REQ. SHIP BUILT IN SHIPPED
DATE TAG DATE SHIP DATE TIME ON TIME

9/3 72547 9/11/08 9/15/08 9/26/08 YES NO
9/16 72794 10/1/08 10/08/08 10/6/08 YES YES
9/16 72793 10/1/08 9/30/08 10/1/08 NO NO


TRAILERS SHIPPED: 3
BUILT IN TIME: 2
NOT BUILT IN TIME: 1

When I do my totals TRAILERS SHIPPED comes out right but BUILT IN TIME will show like 160 when there is only 3 trailers. There will ne no NULL feilds
 
If you are getting 160 for the above sample data, then you must be showing us a sample of data in a group section. Is that correct? You need to look at the data in the detail section to see how the data is repeating on change of some field. Then you have to build that into the evaluation formula. Can't really help more without seeing a sample of detail level data.

-LB

 
REQ ON
ASSY SHIP SHIP TIME
8/6 71646 DTRASCAL-7K 7/28/08 8/6/08 8/6/08 YES
8/6 71646 DTRASCAL-7K 7/28/08 8/6/08 8/6/08 YES
8/6 71646 DTRASCAL-7K 7/28/08 8/6/08 8/6/08 YES
8/6 71646 DTRASCAL-7K 7/28/08 8/6/08 8/6/08 YES
8/6 71646 DTRASCAL-7K 7/28/08 8/6/08 8/6/08 YES
8/6 71646 DTRASCAL-7K 7/28/08 8/6/08 8/6/08 YES
8/6 71646 DTRASCAL-7K 7/28/08 8/6/08 8/6/08 YES
8/6 71646 DTRASCAL-7K 7/28/08 8/6/08 8/6/08 YES
8/6 71646 DTRASCAL-7K 7/28/08 8/6/08 8/6/08 YES
8/6 71646 DTRASCAL-7K 7/28/08 8/6/08 8/6/08 YES
8/6 71646 DTRASCAL-7K 7/28/08 8/6/08 8/6/08 YES
8/6 71646 DTRASCAL-7K 7/28/08 8/6/08 8/6/08 YES
8/6 71646 DTRASCAL-7K 7/28/08 8/6/08 8/6/08 YES
8/6 71646 DTRASCAL-7K 7/28/08 8/6/08 8/6/08 YES
8/6 71646 DTRASCAL-7K 7/28/08 8/6/08 8/6/08 YES
8/6 71646 DTRASCAL-7K 7/28/08 8/6/08 8/6/08 YES
8/6 71646 DTRASCAL-7K 7/28/08 8/6/08 8/6/08 YES
8/6 71646 DTRASCAL-7K 7/28/08 8/6/08 8/6/08 YES
8/20 71839 EH20-14HD 8/14/08 8/29/08 9/5/08 YES
8/20 71839 EH20-14HD 8/14/08 8/29/08 9/5/08 YES
8/20 71839 EH20-14HD 8/14/08 8/29/08 9/5/08 YES
8/20 71839 EH20-14HD 8/14/08 8/29/08 9/5/08 YES
8/20 71839 EH20-14HD 8/14/08 8/29/08 9/5/08 YES
8/20 71839 EH20-14HD 8/14/08 8/29/08 9/5/08 YES
8/20 71839 EH20-14HD 8/14/08 8/29/08 9/5/08 YES
8/20 71839 EH20-14HD 8/14/08 8/29/08 9/5/08 YES
8/20 71839 EH20-14HD 8/14/08 8/29/08 9/5/08 YES
8/20 71839 EH20-14HD 8/14/08 8/29/08 9/5/08 YES
8/20 71839 EH20-14HD 8/14/08 8/29/08 9/5/08 YES
8/20 71839 EH20-14HD 8/14/08 8/29/08 9/5/08 YES
8/20 71839 EH20-14HD 8/14/08 8/29/08 9/5/08 YES
8/20 71839 EH20-14HD 8/14/08 8/29/08 9/5/08 YES
8/20 71839 EH20-14HD 8/14/08 8/29/08 9/5/08 YES
8/20 71839 EH20-14HD 8/14/08 8/29/08 9/5/08 YES
8/20 71839 EH20-14HD 8/14/08 8/29/08 9/5/08 YES
8/20 71839 EH20-14HD 8/14/08 8/29/08 9/5/08 YES
8/20 71839 EH20-14HD 8/14/08 8/29/08 9/5/08 YES
8/20 71839 EH20-14HD 8/14/08 8/29/08 9/5/08 YES
8/20 71839 EH20-14HD 8/14/08 8/29/08 9/5/08 YES
8/20 71839 EH20-14HD 8/14/08 8/29/08 9/5/08 YES
8/20 71839 EH20-14HD 8/14/08 8/29/08 9/5/08 YES
8/20 71839 EH20-14HD 8/14/08 8/29/08 9/5/08 YES
8/20 71839 EH20-14HD 8/14/08 8/29/08 9/5/08 YES
8/20 71839 EH20-14HD 8/14/08 8/29/08 9/5/08 YES
8/20 71839 EH20-14HD 8/14/08 8/29/08 9/5/08 YES
8/20 71839 EH20-14HD 8/14/08 8/29/08 9/5/08 YES


The other view was in a group, above is example of the detail section, it repeats the tag number many times thats why i am getting the weird numbers. How do I only get it to count each tag only one time?
 
Change the evaluation formula in the running total to:

(
onfirstrecord or
{table.tag} <> previous({table.tag})
) and
{BKARINVL_BBM.BKAR_INVL_ESD} > {WORKORD_BBM_1.MTWO_WIP_AFIN}

Substitute your actual field name for {table.tag}. For the last clause I just eliminated the extra step of using a formula that returned "yes"--just for simplification.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top