Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
r3iuk
Creator
Creator

Simple Moving Average within a Script

I want to calculate a Simple Moving Average within my loading script. A SQL based example would be something like:

select a.quote_date, a.close_price, AVG(b.close_price) [20_day_sma] from
my_stock a
join my_stock b
on a.quote_date >= b.quote_date
and b.quote_date >= DATEADD(dd,-20,a.quote_date)
group by a.quote_date, a.close_price
order by 1

Is there a way to do this self join technique in QlikView?

0 Replies