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

Crystal Formula

Status
Not open for further replies.

ba4crm

Technical User
Dec 19, 2003
92
US
Hi,
I have been trying to write up a formula and am getting kinda stuck. The formula is intended to display the contents of table "RootCause.Sym" if the Root Cause is chosen and I want the report to display the word "Blank" if no Root Cause is chosen.
Here is what I have so far:

//I have a stringvar called RootCause which is looking at the table "RootCause.Sym".

stringvar rootcause :={ROOTCAUSE.SYM};
//if the rootcause field is populated, then display
//whatever is chosen
if rootcause like {ROOTCAUSE.SYM} then {ROOTCAUSE.SYM}
else "Blank"
//else display the word "Blank". I am thinking I have
//something wrong in the last line since I am able to get
//the RootCause.Sym to display when something is chosen,
//but I cannot get the word Blank to display. All I have
//is a blank space for the line that does not have a root
//cause chosen.

Can you help?
 
Hi,
It looks a little confusing..
Is RootCause.Sym a field or a table?

You seem to be comparing something against itself -
When are you evaluating this formula?

Please clarify the phrase
not have a root cause chosen.

Chosen How?

More details would help( include Version, OS, full formula code, etc)

[profile]


 
Perhaps you meant to compare to a parameter the user responded to?

Try the following:

if isnull({ROOTCAUSE.SYM})
or
{ROOTCAUSE.SYM} = "" then
"Blank"
else
{ROOTCAUSE.SYM}

This assumes that rootcause.sym is a string.

-k
 
Synapsevampire - your version of the code worked perfectly. Thanks!
Turkbear - RootCause is the table and .sym is the field within the table. By "rootcause not chosen" I was trying to say that the rootcause is an optional field and may not have been picked by the end user. Thanks for your reply.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top