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

if formula needed

Status
Not open for further replies.

nattyborneo

Technical User
Feb 1, 2011
29
DE
hi all,

please help..
I have report

coulumn a contain grouping code
coulumn b contain summary of a value
coulumn c contain summary of b value

I suppress the row if both coulumns (b and c) have 0 as value. The report can have several model output like, for ex :
coulumn a contain AAX
coulumn b contain 100
coulumn c contain 0
OR
coulumn a contain ABX
coulumn b contain 0
coulumn c contain 100
OR
coulumn a contain ABX, AAX
coulumn b contain 0, 100
coulumn c contain 100, 0

I want to failed any report which contain any value only in coulumn c by dividing the summary with 0 (from the example I want to fail sample number 2)

but everytime there is a value in coulumn b the report should be success to run. (from the example I want to run sample number 1 and 3)

any idea how to do it?
I am desperately need advice.

thanks
nat

 
I am not certain i 100% understand the question, and do not have crystal in front of me to test, but...

The below formula, put into the details section, should return a 0 if column B has no value (is null) or has a value of only 0.

//{@test}
IF isnull({Table.B}) OR {Table.B}=0 then 0
else 1

You can then suppress using the section expert any detail where the result of {@test} is equal to 0


 
Dear fisheromacse ,

coulumn a coulumn b coulumn c
AAX 100 0
ABX 0 100

I want to fail the report with divide it by 0 if report only contains value in coulumn c or 0 in both coulumn

I need to run the report each time there is value in coulumn b

but if I make if logic, let say
IF {coulumn b}=0 then {coulumn b}/0 else 0
coulumn a coulumn b coulumn c formula
AAX 100 0 0
ABX 0 100 fail

but it shouldn't fail because first row is correct.

any idea?

thanks
Nat
 
You could either suppress all sections with:

Maximum({table.columnB})=0

or cause an error message when B only contains 0 by using:

{columnC}/maximum({table.columnB})

-LB
 
Hi Ibass,

the problem is :
coulumn b and coulumn c are group value (summary).

I think we can't put maximum in summary.
or???

rgds,
Nat
 
You should still be able to use the concept. Your summary value will only be 0 if the field you are summarizing is zero (unless you can have negative values--which I assume is not the case). So use a summary that cuts across groups (no group condition), as in:

maximum({table.field}) = 0

...where field is the field you are summarizing in columnb.

-LB
 
What I want is :

I have several data
CODE value
AAB -1
ABC -5
AAB -1
ABC -5
ABC -5
ABC -5
ACC 0
ACC 0


I give formula
if {value} = -1.00 then 1 else 0
if {value} = -5.00 then 1 else 0

then group the code and sum the formula flag.

It will show
CODE -1 -5
AAB 2 0
ABC 0 4
ACC 0 0
I suppress ACC because it contains 0 for both -1 and -5

And then I want to run the report each time -1 column has value.
How to do this?
 
HI Ibass,

I got what you mean...

sorry I am just stressfull, actually I also though the same think before but it is somehow mix with other stuff.

Thanks for the help...

rgds,
Nat
 
You can use a suppression formula like this:

sum({@-1formula}) = 0

Or, cause an error by using:

sum({@-5formula})/sum({@-1formula})

Not sure how you are controlling running the report. These suggestions would require the report to be run in order to test the criteria.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top