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

Null Values and running totals in Crystal Reports 1

Status
Not open for further replies.

report2000

Technical User
Mar 1, 2005
45
US
Hi,
I am using running total feature in crystal reports to do my calculations.
I would like to replace a value in my report with a "*" if the value is "0" or "Null"

thank you
 
So instead of using the Running Total as your oputput field, use a formula that references the RT, as in:

If isnull({#MyRT})
or
{#MyRT} = 0 then
"*"
else
totext({#MyRT},0,"")

Note that you should adjust the 0 for the number of decimal places, and the "" to "," if you want a thousands seperator.

-k
 
I have to use the running total (the way the report is set up).
How can I use a running total and a formula for a same field?

Thank you.
 
I never siggested that you not use the Running Total, although I doubt that you really need one, you can do anything in a formula that a Runnign Total does, they just simplify some things.

Please look at my formula again, it is referencing a Running Total, so replace the name {#MyRT} with YOUR Running Total, then use the formula to display the Running Total results, you can remove your Running Total from the report canvas.

If something fails, please post what you tried, and where.

-k
 
Thank you very much for your valuable input. It is working. But I encountered another problem
I have a result = 11.91 but when I use your suggested formula it returns "12". (please note that I used the runnning total to calculate this field and used the following criteria:

FieldToSummerize = AvgHourlyPay
TypeOfSummary = Pth Percentile
P = 10

result = 11.91
Using the your suggested formula = 12

Thank you for your understanding.
 
Adjust the formula to:

If isnull({#MyRT})
or
{#MyRT} = 0 then
"*"
else
totext({#MyRT},2,"")

If you read my post you will see "Note that you should adjust the 0 for the number of decimal places, and the "" to "," if you want a thousands seperator."

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top