Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Covariance matrix

I am trying to do a covariance matrix in QlikSense.  Here is a sample of data:

Load

*

    , product AS product_2

    , price AS price_2

Inline [

customer, product, price

c1, beans,.2

c1, peas,.4

c1, corn,.1

c2, beans,.9

c2, peas,.7

c2, corn,.4

c3, beans,.6

c3, peas,.7

c3, corn,.1

c4, beans,.9

c4, peas,.2

c4, corn,.4

];

The duplicate dimensions are so that I can do a pivot table with 'product' as rows and 'product_2' as columns (QS does not permit the same dimension to be used for rows and columns) then using as the measure: RangeCorrel(Aggr(max(price), product), Aggr(max(price_2), product_2)) but this does not work.

2018-09-13_11-20-25.jpg

If I change the measure formula to Correl(price, price_2) I can get the value of 1 on the diagonals, but notihng else.

Any thoughts?  Thanks in advance.

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Well funny that I didn't search on 'correlation matrix' because there is lots of help on that.

View solution in original post

2 Replies
Anonymous
Not applicable
Author

Well funny that I didn't search on 'correlation matrix' because there is lots of help on that.

cprasad111
Contributor II
Contributor II

How did you achieve the covariance/correlation matrix?