Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
mjirges
Partner - Contributor II
Partner - Contributor II

Is it possible to write a formula that would check if an assessment happens every N days?

We have a request for a compliance dashboard, and one thing they are looking for is if the BPRS assessment is completed every 7 days through a episode of care for a patient.

I only have access to qlik expressions in charts, cannot script anything.

What I've tried, as a proof of concept, is getting the maximum date interval between assessment dates, by Patid and episode:

Max(
Aggr(
Interval(
[Brief Psychiatric Rating Scale Version 4.0.Data Entry Date],
Previous([Brief Psychiatric Rating Scale Version 4.0.Data Entry Date]),
'd'
),
[Episode ID]
)
)

I tried putting this into a straight table, with the only columns being dimensions for the patient name and episode number (Episode ID is a unique identifier that combines both fields). This formula gives me a null result. I'm not sure there is a way to do this, and I don't even know if that "Previous" is the right function for this.

Thank you!

Labels (2)
1 Reply
mjirges
Partner - Contributor II
Partner - Contributor II
Author

Here is a formula that I tried that gets me the difference between each record, but I was needing a "Yes" or "No" on the patient, if they were compliant, thus the need for the max <= 7 days. 

If(
[Episode ID] <> Above(TOTAL[Episode ID]),
Interval([Brief Psychiatric Rating Scale Version 4.0.Data Entry Date] - [Client Admission.Begin Date], 'DD'),
Interval([Brief Psychiatric Rating Scale Version 4.0.Data Entry Date] - Above(TOTAL [Brief Psychiatric Rating Scale Version 4.0.Data Entry Date]), 'DD'))