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!

CrossTab Forumla Help 1

Status
Not open for further replies.

puter55

Programmer
Apr 11, 2003
16
US
CR XI

My tables have a hierarchal setup.
DistUnits
DistCodes
DealerCodes

Not All DistCodes have a DealerCode


I have a report with a crosstab. Currently the report is grouped by
Group1 Date
Group2 DistUnit

Within Group 2 is a crosstab setup as follows
Column is customerName
Row is a formula @routename that just has DistcodeName
Summarized Field @circCount is DistCodeCirculationCount

Everything is working up to this point. I need the crosstab to show the DealerCodeNames instead of the DistCodeName if there is data in the DealerCode information, if there isn't I need it to show the DistCodeName

I assume I need to do this with forumulas for the rows and summarized fields, but I can't get the data display correctly.
If I use @routename
Code:
if dealercodecirculationcount > 0 then dealercodeName
else distcodeName

Then only the records with that have a dealercode linked to them show up on the report. The records with DistCodes only disappear.

Any help is appreciated.

Thanks
 
You need to use a left join FROM DistCodes TO DealerCodes, with no selection criteria on the DealerCodes fields. Then use a formula like this:

if isnull({dealercode.Name}) then
{distcode.Name} else
{dealercode.Name}

-LB
 
lbass

That is really close, it is doing something that I don't quite understand though. It appears to be combining all of the distcode.Name into 1 row and displaying it as a blank name. The circulation Counts are correct, but for some reason it rolled them all up into 1 row in the Crosstab.

Any ideas as to why?
 
If the crosstab is in a group #2 section, SHOULD there be more than one distcode.name per DistUnit? Try copying the crosstab into the Group #1 footer and/or the Report footer to see how it displays there.

-LB
 
Yes, the crosstab is in Group #2 and there are multiple distcodes per distUnit. When I move the crosstab to the report foot it does the same thing, it rolls everything up that doesn't have dealercode into 1 line with a blank name.

Thanks for all of your help so far.
 
Please show the exact formula you used.

-LB
 
if isnull({AoDealerCodes.Name}) then
{AoDistCodes.Name} else
{AoDealerCodes.Name}

Although it would probably help if I updated the correct formula. Everything is working fine. You were correct a few posts up. Sorry.

Again, Thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top