Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I have hard time understanding the difference between this two expressions. I think they should return the same thing but the second one should work faster. Am I right?
1)
Avg({$<[Place of Service Code]={11}>}
Aggr
( Max( %CHARGE_ENTRY_DAY_KEY) - Max( %SERVICE_DAY_KEY)
,%PATIENT_ENCOUNTER_ID, [CPT Code]
)
)
2)
Avg(
Aggr
( Max( {$<[Place of Service Code]={11}>} %CHARGE_ENTRY_DAY_KEY) - Max( {$<[Place of Service Code]={11}>} %SERVICE_DAY_KEY)
,%PATIENT_ENCOUNTER_ID, [CPT Code]
)
)
i did some tests and looks like while results are the same, the second expression works 2-3 times faster. I guess it makes sense because aggr filters data first so outer aggregation has less data to work with.