Print Page | Close Window

Warning legend formula in case a row equals zero

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22396
Printed Date: 01 May 2024 at 11:08pm


Topic: Warning legend formula in case a row equals zero
Posted By: sanur13
Subject: Warning legend formula in case a row equals zero
Date Posted: 23 Jul 2017 at 10:33pm
Hi everyone,

I have a formula that multiplies the number of pieces produced by their price, for each row. The problem is that sometimes the price was not entered in the database, so it's zero. I have suppressed the details section, so that only the total is shown. I would like to make a formula to insert on the group footer, that warns us with the legend "incomplete" whenever there's a line with an article price as zezro.

Example

Details section (suppressed)

Pieces   Price    Pieces * Price
2        10          20
3        10          30
5        0            0
5        5            25
4        1            4
8        5            40
9        10          90

Group footer

                  Total
                   209           "incomplete"
                                   This is what I want to be shown, since we have a price zero at the first line of the 5 pieces. If all the pieces had a price, this legend would need to be hidden. So the formula has to be conditional.


Thanks a lot,
Santiago



Replies:
Posted By: sanur13
Date Posted: 23 Jul 2017 at 11:22pm
I just found the solution. Actually if you write the formula as if it was meant for the deatils section, and place it in the group footer it works fine.

Formula :

if {ARTICLE.PRICE} =0 then "INCOMPLETE" else ""

This will show INCOMPLETE at the group footer whenever there's a row with a zero price.


Posted By: Sastry
Date Posted: 24 Jul 2017 at 3:22am
Hi

I don't think the formula which you have placed in group footer will not work all the times. Because, it always pull group last record price then it compares it with zero.

Do the following to avoid inaccurate results :

The same formula you place it in detail instead of in group footer, then create below formula and place it in group footer.

Maximum({@formual},Groupname)

Thanks,
Sastry

-------------
Thanks,
Sastry



Print Page | Close Window