Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I would like to count all patients who are admitted to a hospital within the quarter.
Something like -
If(Admission_Date>= 01/10/2019 AND <= 31/12/2019, Count Admission_Number)
Thank you
Hi @Taylorcc
Assuming that your Admission_Date is also in the DD/MM/YYYY format, you should be able to use something like:
Count({<Admission_Date = {">= 01/10/2019 AND <= 31/12/2019"}>} Admission_Number)
Update: Count({<Admission_Date = {">= 01/10/2019 <= 31/12/2019"}>} Admission_Number)
Alternatively you can use:
Count(If(Admission_Date >= Date('01/10/2019') AND Admission_Date <= Date('1/12/2019'), Admission_Number))
If your Date is giving you problems you can just put your Admission_Date in a Date() as well.
Hope this helps.
Regards,
Mauritz
Hi @Taylorcc
Assuming that your Admission_Date is also in the DD/MM/YYYY format, you should be able to use something like:
Count({<Admission_Date = {">= 01/10/2019 AND <= 31/12/2019"}>} Admission_Number)
Update: Count({<Admission_Date = {">= 01/10/2019 <= 31/12/2019"}>} Admission_Number)
Alternatively you can use:
Count(If(Admission_Date >= Date('01/10/2019') AND Admission_Date <= Date('1/12/2019'), Admission_Number))
If your Date is giving you problems you can just put your Admission_Date in a Date() as well.
Hope this helps.
Regards,
Mauritz
Thank you! The second suggestion worked
Do you know how I could count unique admission numbers? I tried to use Distinct before and after Admission_Number but this didn't work
THanks again!
I think you need SET ANALYSIS, then the DISTINCT before Admission_Number.
Hi @Taylorcc
Sorry, for some reason I added an unnecessary AND in the set expression. I updated it.
OLD: Count({<Admission_Date = {">= 01/10/2019 AND <= 31/12/2019"}>} Admission_Number)
NEW: Count({<Admission_Date = {">= 01/10/2019 <= 31/12/2019"}>} Admission_Number)
If you want to only count the distinct Admission_Numbers then use:
Count(DISTINCT{<Admission_Date = {">= 01/10/2019 <= 31/12/2019"}>} Admission_Number)
Hope it helps.
Mauritz