Solved

Crystal Reports - Formula - comparison of values

Posted on 2009-04-29
397 Views
I need to build a formula that has 4 potential results. I have it working with 3 but can't figure the 4th piece out. Here is the formula from mlmcc

Local NumberVar Q408Q109;
Local NumberVar Q208Q308;

Q408Q109 := ({#Running Q408 and Q109});
Q208Q308 := ({#Running 2Q - 3Q Total});

If Q408Q109  > Q208Q308  then
"UP"
else if (Q408Q109 = 0) and (Q208Q308 = 0)  then
"INACTIVE"
else
"DOWN"

After a closer look at the data, I need a 4th variable. Here's an example of the data that would be represented;
1) UP  - Up from last time period (2 cases in Jan and 3 cases in Feb)
2) Down  - Down from last time period (3 cases in Jan and 2 cases in Feb)
3) Inactive - Shows no activity in either time period being compared (i.e. Zero cases in Jan and Zero cases in Feb)
4) FLAT - Shows activity in both time periods but each is equal to the other (i.e., 3 cases in Jan and 3 cases in Feb) so NOT INACTIVE but FLAT

I tried something like this to read if (Q408Q109 = Q208Q308) and = 0, then FLAT. Here's my attempt at the formula:
else if ((Q408Q109 = Q208Q308) <> 0)  then
"FLAT"
but I get an error indicating that Crystal is expecting a boolean in pace of the "0" which I understand but I don't know how to fix to get the result I am after.

Any help would be GREAT! Thanks in Advance!

0
Question by:dsabine
1 Comment

LVL 100

Accepted Solution

Local NumberVar Q408Q109;
Local NumberVar Q208Q308;

Q408Q109 := ({#Running Q408 and Q109});
Q208Q308 := ({#Running 2Q - 3Q Total});

If Q408Q109  > Q208Q308  then
"UP"
else if (Q408Q109 = 0) and (Q208Q308 = 0)  then
"INACTIVE"
else if Q408Q109  < Q208Q308
"DOWN"
else
"FLAT"

mlmcc
0

Featured Post

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
This video discusses moving either the default database or any database to a new volume.