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 certain part of a group

Status
Not open for further replies.

jongag1

Technical User
Feb 1, 2002
65
NL
Hello,

I have a report with 2 groups; 1 for the date and one for certain statusses.
It now looks like this:

12042005
not interested 3
wrong number 5
----- a lot of other statusses -----
contract 1 year 3
contract 2 years 2
flex contract 5
18 records in total
13042005
not interested 2
----- a lot of other statusses -----
flex contract 1
3 records in total

I would like to count the contracts (I tried the like command, it works in the detail part) and let it show like:

12042005
not interested 3
wrong number 5
----- a lot of other statusses -----
contract 1 year 3
contract 2 years 2
flex contract 5
18 records in total, 8 contracts
13042005
not interested 2
----- a lot of other statusses -----
flex contract 1
3 records in total, 1 contract

The date is in group header 1, the statusses are in group footer 2, and the total is displayed in group footer 1. The others are hidden.

I hope someone can help me out with this.

Kind regards,
Age de Jong
 
Do you have codes that correspond to the descriptive statuses? It would be easier to use those in a formula, but you could use the following if only the statuses you want to count contain the word "contract":

if instr({table.status},"contract") > 0 then 1

Then right click on this formula in the detail section and insert a summary (SUM, not count} at the date group level.

-LB
 
Hi LB,

Thanks for your answer. The formula now gives all zeros.
I think because "contract" is just a part off the status.

I tried:
if instr({APPELS.LIB_STATUS},like "*stroom*") > 0 then 1

But that is not going to work ;-)
Can you help me with this?

Regards,
Age
 
My formula should work if your status field appears as you showed above. It should be placed in the detail section and then the summary should be inserted on it. The instr function looks for "contract" anywhere within the string and returns the position number of its first letter.

-LB
 
Okay, now I understand you.
I wrote: contract 1 year 3

When posting it I used tab but now it looks like the number at the end is part off the status, but it is not.

The status is: contract 1 year
the number behind is the count for the status.

Regards,
Age



 
That doesn't matter. If the {APPELS.LIB_STATUS} has results like:

contract 1 year
contract 2 years
flex contract

...each of these would meet the criteria in the formula:

if instr({APPELS.LIB_STATUS},"contract") > 0 then 1

Try this formula in the detail section and observe what it returns. This might be case sensitive also (I can't remember), so you might check to make sure this is not a factor.

-LB
 
Hello LB,

Got it now, working great.
Tnx.

Kind regards,
Age
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top