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

CRXI chart , count items if other field = 1 1

Status
Not open for further replies.

mgason

Technical User
Feb 6, 2003
158
AU
Hi,
I have a bar chart.
It pulls data from one table "WeighmentReport"

In the Chart Expert data tab...
It is set, on change of "weight" field giving X axis of weight intervals.

show values is batchID, giving a y axis which is a count of batches.

This is fine so far.
But each BatchId has a corresponding 0 or 1 in a field "RealData"

I want to have my Y axis show a count of only those batcID's where the RealData field = 1.

I can not seem to get my head around a formula that works.

Thanks
mark
 
Try a conditional formula:

if {table.realdata} = 1 then
{table.batchID} else
{@null}

...where {@null} is a formula created by opening and saving a new formula without entering anything. This assumes that the batchID is a string. If it is a number, wrap {@null} in tonumber().

Then use count of the above formula as your summary field.

-LB
 
Fantastic, thanks!!
I had tried

if {table.realdata} = 1 then
{table.batchID}

the null formula trick makes sense now that I see it, but I would never have thought of it.

I have another question about the same chart. I have made my Y axis percentage of count of the formula.
can I have a secondary Y axis which shows Count of the formula? When I go into Char options the Multi-Axis tab is greyed out.

Thanks again
mark
 
I sorted it out, the Chart object has an absurd number of dialog boxes that overlap a lot in function.
here is the answer for anyone who may come searching.

Click on the Y axis, Bring up the Data(Y) axis settings dialog. check axis on both sides.

The Chart options dialog Multi-Axis tab will now be active.

I still can not work out why the number tab of the Group X axis options dialog is greyed out, or why when the X axis displays perfectly to 3 decimal places in preview mode in Crystal (seems to be determined by the report options) it displays only 2 decimal places when run in the embedded Crystal active X within an application.

mark
 
Glad you worked it out. I don't know the answer to your last questions.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top