Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
m_monfort
Partner - Contributor III
Partner - Contributor III

Rolling correlations

Hi all,

I wanted to know if it is possible to do a rolling correlations chart like that which is available on the financial app Koyfin?

Below is a screenshot where AAPL (Apple) has been chosen to be compared with SPY (S&P 500 index). The bottom line chart is the time series of daily share price for both but the chart above is a rolling correlation chart with a look back period (N) of 21 days.

I wanted to know if there was a way to do something like this on time series data in QlikView or Qlik Sense so that you can choose N amount of look back days?

Please help - thank you!

Koyfin correlations.PNG

1 Solution

Accepted Solutions
MarcoWedel

maybe you could use an expression like

RangeCorrel(Above([Stock 1],0,21),Above([Stock 2],0,21))

?

hope this helps

regards

Marco

View solution in original post

5 Replies
niclaz79
Partner - Creator III
Partner - Creator III

Hi,

Hard to define without seeing your exact data, but using RangeSum() and Above() is a good bet.

Something like

Avg(RangeSum(Above(Sum(YourValue),0,vDaysToAverage))) Should work, where YourValue is the value you are calculating and vDaysToAverage is over how many days the average is for.

Hope it helps!

MarcoWedel

please post some sample data and your expected result.

m_monfort
Partner - Contributor III
Partner - Contributor III
Author

Hi all,

Thanks for the replies. Please find attached an example time series with 2 stocks in there (it's not for the image above as that was just a screenshot from an app where I'd seen this being done).

Here's the data.

MarcoWedel

maybe you could use an expression like

RangeCorrel(Above([Stock 1],0,21),Above([Stock 2],0,21))

?

hope this helps

regards

Marco

m_monfort
Partner - Contributor III
Partner - Contributor III
Author

Thanks everyone - the RangeCorrel works a treat.