Is there an api call that returns a count of records in the tracker in a program stage. I am using a custom form to generate an alpha numeric ID based on a count of program stage records e.g. no. Of mothers attending ANC. I wanted to use a count returned from an sql view but am wondering if there is another way to this.
A query that will give you the number of events for a given program, program stage, entire country (see ou dimension) and between a start and end date looks like this:
Is there an api call that returns a count of records in the tracker in a program stage. I am using a custom form to generate an alpha numeric ID based on a count of program stage records e.g. no. Of mothers attending ANC. I wanted to use a count returned from an sql view but am wondering if there is another way to this.
Many thanks for this. Its definitely useful, I was looking for a method that doesnt rely on analytics because I am using the ID as a field in a custom reg form for a program.
rgds
Da
Hi Muturi,
one approach is using the event analytics API. Of course this means that the result will depend on when analytics tables were generated last time.
A query that will give you the number of events for a given program, program stage, entire country (see ou dimension) and between a start and end date looks like this:
Is there an api call that returns a count of records in the tracker in a program stage. I am using a custom form to generate an alpha numeric ID based on a count of program stage records e.g. no. Of mothers attending ANC. I wanted to use a count returned from an sql view but am wondering if there is another way to this.