Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
danielgargiulo
Partner - Creator
Partner - Creator

Count records within 30 days? I thought this would be easy....

Hi All,

In the dataset attached I would like to count the number of records from the NNPAC table that fell within 30 days of each unique record/ date in the NMDS table. See data attached. Tables are linked using 'Unique Patient ID'.

Please note the dummy data is only for one Person, in reality i want to do this for up to a million 'Unique Patient IDs'.

Your help and infinite wisdom is much appreciated.

Kind regards,

Daniel

6 Replies
Not applicable

count({<nmpac_date ={">=nmpac_date<=nmpac_date+30"}>}nmpac_date)

danielgargiulo
Partner - Creator
Partner - Creator
Author

HI Ramkumar,

thank you for the reply. Unfortunately, this does not work as i need to use the date fields from the two different tables not just the one.

Thanks

Dan

Not applicable

From which date the 30 days count,means in NMDS table there are many dates available,so from which date the 30 days count.

danielgargiulo
Partner - Creator
Partner - Creator
Author

The count needs to be repeated for each date in the NMDS table. The final straight table should have the fields:

Unique Patient ID, Event Start Date, [Count NNPAC Records within 30 days of Event start Date]

does that make sense?

Not applicable

may be this set analysis script will help you try this

=date(ceil(num(Date([Event Start Date],'dd/mm/yyyy')+30)),'DD-MM-YYYY')

danielgargiulo
Partner - Creator
Partner - Creator
Author

thanks Bhawna. I dont think that will work as it needs to be counting the number of NNPAC records within 30 days of the NMDS date 'Event Start Date'.

thanks

dan