Question

I am trying to count the total number of (First column closed) Closed records. But I Get the result like 1.00 and 0.00 .

Desired results:

count

Code:

Local NumberVar str := 0; 
Local NumberVar strLen := count({@Status}); 
Local NumberVar i; 

For i := 1 To strLen Do ( 
  If instr(i, {@Status}, "Closed") <> 0 Then 
    str := str + 1; 
); 

If(str > 0 ) Then str 
Was it helpful?

Solution

You have two obvious options:

1) Running total with a evaluation expression: instr({@Status}, "Closed") <> 0 set to count 2) Create a new formula if instr({@Status}, "Closed") <> 0 then 1 else 0 then you can summarize that (either in a formula or using a "summary")

OTHER TIPS

Your formula should be:

// formula's result might not always be 'Closed'
IIf( InStr({@Status}, "Closed") > 0, 1, 0 )

or

// formula's result is clean
IIf( {@Status}="Closed", 1, 0 )

** edit **

Insert a summary field that references this formula. By the way, this formula doesn't need to be added to the canvas to function correctly.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top