Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

nested aggregation and set analysis

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]

  )

)

1 Reply
Anonymous
Not applicable
Author

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.