Avatar of mcse2007
mcse2007Flag for Australia

asked on 

A number of currency amount is required here.

Hi,

I'm trying to calculate 10% of my site delivery charge which is tax component but CR is having difficulty via the formula producing the result.

Formula
if {Sheet1_.ZFR2 - Site Delivery} <=0 then "0"
else ({@sdelivery-unit-cost} *.10)

when I check the formula, it highlight this   (@sdelivery-unit-cost}  as part of the error in the formula

@sdelivery-unit-cost is....
if ({Sheet1_.ZFR2 - Site Delivery}) <=0 then ""
else {@sdelivery-sum}


@sdelivery-sum is....
CStr(sum ({Sheet1_.ZFR2 - Site Delivery}, {Sheet1_.Bill#Doc#}),2,'')

Any idea how to fix this?

appreciate your help.
error.bmp
Crystal Reports

Avatar of undefined
Last Comment
mcse2007
ASKER CERTIFIED SOLUTION
Avatar of Kurt Reinhardt
Kurt Reinhardt
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of mcse2007
mcse2007
Flag of Australia image

ASKER

what would be the fix formula then?
SOLUTION
Avatar of Mike McCracken
Mike McCracken

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
There is no one fix formula.  You'd have to change all the dependencies.  You'd first change sdelivery-sum by not converting it to a string.

sum ({Sheet1_.ZFR2 - Site Delivery}, {Sheet1_.Bill#Doc#})

Open in new window


You'd then have to change sdelivery-unit-cost to be something like:

if ({Sheet1_.ZFR2 - Site Delivery}) <=0 then 0
else {@sdelivery-sum}//this formula is a number

Open in new window


You'd then change the final formula to:


if {Sheet1_.ZFR2 - Site Delivery} <=0 then 0
else ({@sdelivery-unit-cost} *.10)

Open in new window


Before you change anything, however, you need to ascertain why you're using strings in the first place.  Is there a specific business rule you're trying to meet? Is this change going to break something else in the report?

~Kurt
Avatar of mcse2007
mcse2007
Flag of Australia image

ASKER

Beautiful. That worked.

Thanks mlmcc...when I'm visiting UK next time, i'll buy you a drink. :-)
Avatar of Mike McCracken
Mike McCracken

Since rhinok pointed out the error and then gave a solution to fix all the formulas he desires a majority of the credit for the solution

mlmcc
Avatar of mcse2007
mcse2007
Flag of Australia image

ASKER

rhinok deserves some points here, that's for sure...sorry mate.
Crystal Reports
Crystal Reports

Crystal Reports is a business intelligence application from SAP SE. It is used to graphically design data connections and report layouts from a wide range of data sources including Excel spreadsheets, Oracle, SQL Server databases and Access databases, BusinessObjects Enterprise business views, and local file-system information. Report designers can place fields from these sources on the report design surface, and can also deploy them in custom formulas (using either BASIC or Crystal's own syntax), which are then placed on the design surface. Crystal Reports also supports subreports, graphing, and a limited amount of GIS functionality.

36K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo