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

CrossTab Group options only allows me to print row by hour or by minute

Status
Not open for further replies.

capronton

MIS
Jun 28, 2013
159
US
I'm trying to create a CrossTab report that will allow me to print "Rows" by "StartTripTime". I would need a row at 5:00am, 5:48am, 6:26am, 7:10am, etc.

Can anyone tell me how I can create a Crosstab report that would print "Rows" at each "StartTripTime"?

I go to Row Options, then Group Options and it says print row for each day, week, year, minute, hour, so forth. Is it possible to customize this?

Thanks.
 
This is what the Crosstab looks like. I want the Crosstab to only show legitimate trips (i.e., 5:55am, 7:03am, 8:04am) How can make non-legitimate start trip times go away?

11/1 11/2 11/4 11/5 11/6 11/7 11/8 11/9 11/10 11/11
4:59 am 0 0 0 0 0 0 0 0 0 0
5:12 am 0 0 0 0 0 0 0 0 0 0
5:55 am 0 0 117 105 105 87 0 0 0 81
7:03 am 0 0 49 59 41 44 0 0 0 47
7:12 am 0 0 0 0 0 0 0 0 0 0
7:23 am 0 0 0 0 0 0 0 0 0 0
7:25 am 0 0 0 0 0 0 0 0 0 0
7:31 am 0 0 0 0 0 0 0 0 0 0
7:39 am 0 0 0 0 0 0 0 0 0 0
7:50 am 0 0 0 0 0 0 0 0 0 0
8:00 am 0 0 0 0 0 0 0 0 0 0
8:04 am 0 0 152 174 156 175 0 0 0 175
 
hi,

You havn't given much information, but the essence of what you ask is when the sum of the aggregations in the crosstab is greater than zero.

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 


...which would probably include a HAVING sql clause similar to...
[coded]
....
having sum([some field name]) > 0
[/code]
for sum or count or average or some other aggregation.

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Skip,

Can you help me get this code to work in the formula editor? I'm trying to get sum of the aggregations in the crosstab is greater than zero then set row to {apc_correlated.start_trip_time}

I'm not sure if I need the WhilePrintingRecords statement

WhilePrintingRecords
if Sum ({apc_correlated.ons}) > 0
then {apc_correlated.start_trip_time}
else 0

Thanks!!
 
You'd want to do this in the query that generates the report.

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
You haven't given us much to go on here.

Based on what you say the Cross Tab looks like, I have assumed that the data structure is fields for StartTripDateDate, StartTripTime, and TripAmount. As CR does not add in data that doesn't exist it seems that there are actually rows in the database with a StartTripDateDate, a StartTripTime, and a TripAmount of zero.

Based on this, add the following to your Record Selection Formula:

Code:
{Table.TripAmount} <> 0

If this doesn't get you what you need, please provide more detail, including the actual data structure. Some realistic sample data would also be useful.

Cheers
Pete
 
Go into the Cross-tab Expert and use the tab for "Customize Style". There is an option to "Suppress Empty Rows" which should do what you want.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top