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

Wrong grouping 1

Status
Not open for further replies.

CrystaLv

Technical User
May 12, 2006
121
US
I am having a blast with another piece of data.
Do I have to use SUB?

ClientID AdrsLoc Adrs AddLoc Loc AddLocDesc

111 Office 1Street Phone Home 213000000
111 Office2 2Street Fax Home 213000001
111 Office 1Street Email Office 2@q.tv
111 Office2 2Street Web Office
I need to display
Addresses Office 1Street
Office2 2Street

AddLocDesc
Home Phone 21300000
Home Fax 21300001
Office Email 2@q.tv
Office Web __________________________________________________
Instead i am getting

Addresses Office 1Street
AddLocDesc
Home Phone 21300000
Home Fax 21300001
Office Email 2@q.tv
Office Web


Addresses Office2 2Street
AddLocDesc
Home Phone 21300000
Home Fax 21300001
Office Email 2@q.tv
Office Web

Thanks
 
There are different ways of handling this. You could create a running total {#cntloc} which does a distinctcount of {table.adrsloc}, evaluate for each record, reset on change of group (clientID).

Insert a group on {table.clientID} and then on table.adrsloc} and then go to the section expert->details->suppress->x+2 and enter:

{#cntloc} <> count({table.adrsloc},{table.clientID})

This should return the details only for the last instance of the address location.

-LB
 
I will try and see what is best. Thanks so much lbass.
 
I have to ask more, please.

Where should i place fields?
I use to have in group on {table.clientID}
Addresses Office 1Street
Office2 2Street
-----------------------------------
and in group on {table.adrsloc}
AddLocDesc
Home Phone 21300000
Home Fax 21300001
Office Email 2@q.tv
Office Web

There is 2 groups now on {table.adrsloc}
and on {table.adrsloc}.
When inserting formula:
{#cntloc} <> count({table.adrsloc},{table.clientID})
on which group should this be inserted?

Thanks
 
Wherever i put supress formula it supresses everything and nothing left to display. But there is a double set of 'adrsloc' - one for each address. Thanks
 
{table.clientID} should be your first group. Then{table.adrsloc} will be the group name for group #2, so just add {table.adrs} to that group header. Place {table.AddLoc},{table.Loc} and {table.AddLocDesc} in the detail section. Then go to the section expert->details and add:

{#cntloc} <> count({table.adrsloc},{table.clientID})

This will only suppress the details if there are more than on set of details per client ID.

-LB
 
Whatever i do - when formula
{#cntloc} <> count({table.adrsloc},{table.clientID})
is active it shows nothing. Whn disabled - shows old result.
Oh, boy! Thanks''You mentioned other ways...
 
I've tried to simplify data where

ClientID AdrsLoc AddLoc

111 Office Phone
111 Office Fax
111 Office Email
111 Office Web
111 Office2 Phone
111 Office2 Fax
111 Office2 Email
111 Office2 Web

So I go
Group1 on ClientID
Group2 on AdrsLoc
It gives me
Office xxxxxxxxxxxxxxxxxxxxxxxxx
Office2 ************************
Detail AddLoc field
expert->details->suppress->x+2 and enter:
{#RunTotal} <> count({table.adrsloc},{table.clientID})

{#RunTotal} which does a distinctcount of {table.adrsloc}, evaluate for each record, reset on change of group (clientID).

Checking formula
if I changed
{#RunTotal} = count({table.adrsloc},{table.clientID}
it gives me old result set of AddLoc per AdrsLoc.
{#RunTotal} <> count({table.adrsloc},{table.clientID}
gives me no AddLocs.

Running in circles...thanks
 
Sorry, that should have been:

{#RunTotal} <> distinctcount({table.adrsloc},{table.clientID})

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top