Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Highlighted
brianrmacdonald
Contributor

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.

Tags (1)
1 Solution

Accepted Solutions
brianrmacdonald
Contributor

Re: Covariance matrix

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
brianrmacdonald
Contributor

Re: Covariance matrix

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

View solution in original post

cprasad111
New Contributor

Re: Covariance matrix

How did you achieve the covariance/correlation matrix?