Reputation: 747
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:
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
Upvotes: 0
Views: 13313
Reputation: 26262
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.
Upvotes: 1
Reputation: 6027
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")
Upvotes: 4