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

Display a total for a formula field grouped by dates

Status
Not open for further replies.

mvalley

Technical User
Mar 4, 2011
80
US
Trying to display a total for a formula field grouped by date.
Formula is :

if({v_CRA_blocks.cr_block_in_pacu_number}>"0")then
{v_CRA_blocks.cr_block_in_pacu_number}

I have 4 patients in this detail section
Pt 1 has 2 blocks
Pt 2 has 1 block
Pt 3 has 1 block
Pt 4 has 2 blocks
Total blocks = 6

Need to put total (6) in the report. I tried several options and nothing seems to correctly display the total. Suggestions please?
 
YOu do not have an else so it will result in a null

Try

if({v_CRA_blocks.cr_block_in_pacu_number}>"0")then{v_CRA_blocks.cr_block_in_pacu_number}
else 0

then do a simple sum summary on this formula, crystal does not like nulls and tends to stop formula and summaries if it encounters them.

Ian
 
Please show a sample of what the data looks like in the detail secton for the patient number and the field cr_block_in_pacu_number and label each.

-LB
 
Ian,

Not specifying a default value for the else does not result in a null. For a string the default would be "", for a number 0--whether or not you add the else.

-LB

 
When I try to insert a summary on this formula field, I do not have the option to select SUM, only Maximum, Minimum, Count, Discint Count, etc. Tried both Coundt & Discint Count, but it is not adding all numbers within the detail section as noted above
(returns 4 rather than 6, based on the patient number??)
 
That's because it is a string. So change the formula to:

if {v_CRA_blocks.cr_block_in_pacu_number}>"0" then
tonumber({v_CRA_blocks.cr_block_in_pacu_number})

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top