Counting instances of date within repeat group

Hi Kalam,

I need you help here.

The above form is a form for a diary where the patient is supposed to enter the day when he applies a cream. i.e his entry for ‘Day’ will be 1, 2,3, 4…etc if he applies regularly a particular cream.
Now if he misses a day or more OR if there are two or more entries for a particular date, the system should throw a note either “Patient has missed a dose” or " Patient has applied additional dose". I am not sure how can I check the same within repeat group. Can you please help me.

Attaching the xlsform for your reference.
TestEnteko.xls (182.5 KB)

Welcome back to the community, @an_ju! These posts discussed previously should help you solve your issue:

And this post too …

Thank you for the suggestions Kalam…However, I went through these before. But I am not able to find a solution on how to reference the dates inside the repeat group. Here we have to check the repetitions on dates which would be entered by the user dynamically. May be I am not getting the right way! Can you please help me.

@an_ju, so if there is a duplicate in the date, it should flag it out? Did I now get it correct?

Yes, absolutely…So if the user enters the same date, the error message should reflect “Additional dosage” and if there is a missed date…for eg if first entry of date is 05/sep/23 and second entry is 07/sep/23, it should also flag it as “missed dosage”. Please help as I could not figure this out.

@an_ju, OK, this post discussed previously should help you solve your issue then:

Sorry Kalam, unfortunately this isnt working for me. The example you provided has choices and we have to figure out the duplicates from within the choices. However, my issue is that the dates are provided dynamically and I am not able to understand how can I use the previous date entry and use it to compare with the current date withing the repeat group. Thank you for trying.

Hi Kalam,

I got the solution to my issue.
Attaching the form for reference in case if anyone finds this helpful.
I have used a note to show the messages, but the conditions can be used under constraint to restrict entry.

Thank you.

Check duplicates within repeat and figure out missed date within repeat.xls (185.5 KB)