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

Display time when not valued

Status
Not open for further replies.

JMB7

MIS
May 19, 2004
26
US
Crystal 8.5, SQL Database

Hello,
I wrote a cross tab report where I am trying to display the number of patient discharges by nurse station by hour. Nurse station is on left and time range across top. I have a formula that converts the actual time into the 'hour' of discharge.

EX.
if {@hour} = 0 then '0000 - 0059' else
if {@hour} = 1 then '0100 - 0159' else
if {@hour} = 2 then '0200 - 0259' else
if {@hour} = 3 then '0300 - 0359' else ...

My issue is the report does not display a time range when it is not valued. I need the time ranges to always display regardless of any data.
Thanks for any help.
 
You would need to use a manual crosstab to accomplish this unless you can create a periods table that holds all the times.

-LB
 
I am new to manual crosstabs. I looked for a sample and found thread149-548521 with which I believe to have a similiar issue. Using an Array was also mentioned.

So I used...
whilePrintingRecords;

stringvar array nurseunit:=['2BR','3BR','4BR'};
stringvar array hourofweek:=['0001-0059','0200-0259','0300-0359','0400-0459','0500-0559','0600-0659','0700-0759','0800-0859','0900-0959','1000-1059','1100-1159','1200-1259','1300-1359','1400-1459','1500-1559','1600-1659','1700-1759','1800-1859','1900-1959','2000-2059','2100-2159','2200-2259','2300-2359'};

Am I on the right track? I am lost - please help.

This is part of my original crosstab report. I realized that times and nurse stations were missing due to no values. I need them both displayed regardless of a value. Thanks

0000 - 0059 0800 - 0859 0900 - 0959

4BR 1 4 0
3BR 0 0 6
2BR 0 0 9
 
As long as there is at least one record per nurse station (for the entire report period) then the manual crosstab approach would work. I would not use arrays though, since I think there is a simpler way.

First group on {table.nursestation}. Then create a series of formulas like the following:

//{@0000-0059}:
if hour({table.dischargetime}) = 0 then 1 else 0

//{@0100-0159}:
if hour({table.dischargetime}) = 1 then 1 else 0

Repeat for each interval. Place these formulas in the detail section and then right click on each one and insert a summary (SUM, not count). Then drag the group name for the nurse station into the group footer and suppress the details section.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top