views:

38

answers:

1

I have a pretty tricky report on my list of things to do and for the life of me I can't figure out a way to accomplish it. To be fair, I'm a pretty big Crystal newbie. Unfortunately, my current task is out of my realm of experience. This is where Stack Overflow comes to the rescue!

My Datasets look like this:

Usage
------
LocationID
CustomerID
Period
Usage
Amount

Customer
------
LocationID
CustomerID
CustomerName
LocationNumber

Period is a length of time (a month) where bill charges were accrued. Usage is the number of units of service a customer has used in a particular period. Amount is the dollar value billed for that usage.

The issue I'm having with the report is as follows: I want to display each period's data horizontally, like so:

LocationNumber: CustomerName - CustomerID
Period1 - Period2 - Period3 - Period4
Usage1 - Usage2 - Usage3 - Usage4
Amount1 - Amount2 - Amount3 - Amount4

So essentially, in column form, display all amounts and usages for each period a customer has. Can anyone please give some insight on what the grouping should look like?

+3  A: 

I misspoke -- you can't have a crosstab in the detail section, only group header or group footer.

That said, you could try building your report like this:

 ---------------
Report Header
---------------
Page Header
---------------
Group Header (Group by CustomerID, maybe LocationID as well)
LocationNumber: CustomerName - CustomerID

Crosstab

---------------
Group Footer
---------------
Page Footer
---------------
Report Footer

In your crosstab, you can speciy Period for your columns, Customer for the Row, and Usage and Amount for your Summarized Fields.

The only downside to this is that your customer will appear again to the left of the Usage and Amount, but it's a good start, and you can try different formattings from there.

LittleBobbyTables
If I were wanting to compare two cross tabs, is that possible?
treefrog
Do you mean programatically compare data between two crosstabs? If so, then I don't know about that. It might be possible, but I'm not familiar with that feature if it is.
LittleBobbyTables
Yeah, essentially. Finding the difference between a related field in two separate cross tabs.
treefrog
Is this cross-tab comparison thing a part of your original question? If not, asking the question separately would get you better answers and keep the site clean.
PowerUser
As for answering the cross-tab question, I would do that with a formula. If it's complex enough, I'd even calculate it outside of Crystal entirely and feed it in later.
PowerUser