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

Crosstab Data - where is it from

Status
Not open for further replies.

jcfowl

Programmer
Feb 15, 2002
29
0
0
US
I am using a crosstab that has given me problems. I am wondering where the crosstab pulls data from, if you were to compare it to a report. I realize it is in the footer of the report, does that mean it uses subtotals of the information used in each group. I am getting weird results for some entries and am trying to test my data by looking at the data in the details and headers of the report itself before viewing the Crosstab in the footer. Any insight would help me greatly.
 
Generally, a crosstab does a count of the records where the top row and the side row are valid entries, i.e.

data like :

{NameColumn} {FoodColumn}
Bob Bacon
Bob Bacon
Jeremy Bacon
Jeremy Eggs
Jeremy Eggs
Bob Eggs

Would Give:

Bob Jeremy
Bacon 2 1
Eggs 1 2

But it all depends on the data you are using to create the crosstab.

Reebo
Scotland (Sunny with a Smile)
 
I have a location row and a Sequence column. I am summarizing the Items delivered to a location and in what sequence they are delivered. If I look at the report I get data like this in the details:

I006 FEED
I006 OTHER

In the crosstab I get an entry like

1 2
I006 BOX BOX

INSTEAD OF:

1 2
I006 FEED OTHER

It doesn't match the items showing up in my details section. Why would that happen?
 
The crosstab your trying to create would give :

FEED OTHER
I006 1 1

Sorry, I'm not the best source of info for crosstabs



Reebo
Scotland (Sunny with a Smile)
 
to simplify this question let me rephrase it like this:
I have 1 Group
In the details of that group are 3 fields: location, sequence and Type

In the crosstab:
Row = location
Column = Sequence
Summarized field is the Max of Type

The problem is I am not getting the correct data in the summarized field. How does the crosstab get the information, or maybe I should ask from where does it get the data: header, details or footer?
 
The crosstab is just going to give you those values found in the intersection of the row and the column. What is your one group? If the group is based on location or sequence, make sure you have created this as a group within the crosstab. After adding it as the row or column field, click on it, and choose group options and recreate your group there.

If you have the crosstab in the report footer, it will use the values from the entire report, so if the location is represented in multiple row groups (this assumes your group is not on location), e.g., the maximum function will pick up the maximum across groups as long as it meets the location and sequence criteria.

Similarly, if values for sequence are repeated per location because of your grouping, the crosstab will pick up the maximum for that sequence at that location. So it would also be helpful to know what "sequence" is--a table field? A formula? Is it a datetime or a number field representing order?

If you place the crosstab within the group footer, it will limit the values to the specific group, but then you will have a crosstab repeating on change of group.

-LB

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top