Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Correl function with aggregation

Hello,

I want to calculate the correlation between two dataset. How can I use a set analysis in the correl expression. This is what I tried, but that doesn't work:

Correl(avg({$< Variable = {"P02.01"}>}TOTAL #score),avg({$< Variable = {"P03.01"}>}TOTAL #score))


Who can help?

1 Reply
swuehl
MVP
MVP

The Correl() function should operate on pairs of dimensional data values, not on a pair of scalar values.

I think you would need to apply advanced aggregation, something like

Correl(

Aggr( avg({$< Variable = {"P02.01"}>}#score), Dimension) ,Aggr(avg({$< Variable = {"P03.01"}>}#score), Dimension)

)