Hi!
I am trying to adjust total inspection quantity per day based on the "Single Count?" column. Created a new inspection quantity column Inspected_TTL_New. If the input in this column is "F", Inspected_TTL should be same as Inspected_TTL_New. But if it is "T", Inspected_TTL_New column should be the Inspected_TTL quantity for "F" on the same day.
This is how far I got:
inspected_ttl_temp = 0;
For Each Row(
If( :SINGLE COUNT? == "F",
:Inspected_TTL_New = :Inspected_TTL;
inspected_ttl_temp = :Inspected_TTL,
);
If( :SINGLE COUNT? == "T",
:Inspected_TTL_New = inspected_ttl_temp,
);
);

This is what I'm trying to do:

I tried to create a for loop below with incremental dates to capture the inspection quantity per each day but couldn't get it to work
inspected_ttl_temp = 0;
startdate = "2022-08-01";
for(i="2022-08-01",i<=MAX(:DATE), i++,
For Each Row(
If( :SINGLE COUNT? == "F",
:Inspected_TTL_New = :Inspected_TTL;
inspected_ttl_temp = :Inspected_TTL,
);
If( :SINGLE COUNT? == "T",
:Inspected_TTL_New = inspected_ttl_temp,
);
);
);
Please help!!