What is the actual value of a choice field
I'm trying to display the number of records with different values in a choice box in a linked table over multiple records. When I run the following code I should get Pa 28 Fa 1 No 0 but I just get 0,0,0
Part of the trouble is I'm not sure what the actual value is I'm supposed to be comparing to the choice field. Is it a string, value, or do I need to do a number() value?
Please help me understand what I'm doing wrong.
This is the code below.
let current := Id;
let Pa := 0;
let Fa := 0;
let No := 0;
for j in select 'Inspection Sheet Items' where 'Inspection Sheet'.Id = current do
if number(j.'Pass/Fail') = 1 then
Pa = Pa + 1
end;
if j.'Pass/Fail' = 2 then Fa = Fa + 1 end;
if j.'Pass/Fail' = 3 then No = No + 1 end;
alert(Pa + " " + Fa + " " + No)
end
1 reply
-
Is it possible to delete this? It seems like I don't realise my mistakes until about 30 seconds after I post to this forum.
(I did compare instead of assign. = instead of :=)
Content aside
- 4 yrs agoLast active
- 1Replies
- 561Views