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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

counting and grouping CR

Status
Not open for further replies.

nattyborneo

Technical User
Feb 1, 2011
29
DE
Dear all guru,

need urgent your advice...
I have table :

branch code branch key
JPKL 12
USBR 10
USBA -8
JAKL -2
BILO -8
KLMN -2
BILO -8
JAKL -2
JAKL -2

I want to have the result of counting (for -8 and -2), like this
branch code count -8 count -2
USBA 1 0
JAKL 0 3
BILO 2 0
KLMN 0 1

any advice, how to do that?
thanks...

rgds,
NAT
 
You'll need a couple of formulas that look something like this:

{@Count-2}
if {table.branch_key} = -2 then 1 else 0

Now you'll group on Branch Code and Sum these two formulas for the group for your Count-2 and Count-8 columns.

-Dell

A computer only does what you actually told it to do - not what you thought you told it to do.
 
Dear Hilfy,

thanks for the help.
If I get the result is = 0,
I want to supress the zero number.

how to do this?
tahnks again.

rgds,
LN
 
Right-click on the object on your report and select "Format...".
- Go to the Common tab.
- Click on the formula button to the right of the Suppress check box (do NOT check the checkbox!)
- Type in something like the following:
sum({@Count-2}, {table.branch_code}) = 0

This should suppress the 0's. If that doesn't work, try deleting the "else 0" from your formulas.

-Dell

A computer only does what you actually told it to do - not what you thought you told it to do.
 
You could just right click on the formula->format field->number->customize style->suppress if zero.

You could also use hilfy's suggestion, but you should be able to use:

currentfieldvalue = 0

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top