0

Correction - Counting the number of items that have a flag set.

Apologies for the second post.  I had a confusing typo.

Good afternoon;

I'm trying to learn how to count the number of entries with a particular status set.

1. I have two tables: JOBS and TASKS.

2. Each entry in JOBS can have multiple TASKS assigned to it, so I have TASKS -> JOBS.

3. Each entry in TASKS can have a flag set for either done or outstanding.

Problem Statement: I would like to be able to count # of outstanding tasks for a given job.

_____

I have tried constructing a filter for this using the visual editor.  I can see how to count the number of tasks for each job (cnt), what the first or last task is for a particular job, or to concatenate the status.

In the text editor I would guess I need something like:

let NumberOutstanding := 0

for Counter in cnt(TASKS)

if item(TASKS,Counter) = "Outstanding" then NumberOutstanding := NumberOutstanding + 1

return NumberOutstanding

_____

Questions:

1. Is this the best way to do this? 

2. How do I return the calculated value

3. Is there a code bank of example code?  

 Thank you very much for your help.

Reply Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
Like Follow
  • 1 yr agoLast active
  • 241Views