Тёмный
No video :(

SQL Query | How to calculate rolling / moving average ? | Ex - 3 day rolling average 

Learn at Knowstar
Подписаться 44 тыс.
Просмотров 9 тыс.
50% 1

In this video, we discuss how to calculate rolling or moving averages in SQL and why are they important.
How to install SQL Server for practice?
• How to install SQL Ser...
Check out the complete list of SQL Query Interview Questions -
• SQL Query Interview Qu...
Best Data Science / Analytics / SQL courses
Learn SQL Basics for Data Science Specialization
imp.i384100.ne...
Data Science Fundamentals with Python and SQL Specialization
imp.i384100.ne...
Python for Everybody Specialization
imp.i384100.ne...
Google Data Analytics Professional Certificate
imp.i384100.ne...
Coursera Plus - Data Science Career Skills
imp.i384100.ne...
Please do not forget to like, subscribe and share.
For enrolling and enquiries, please contact us at
Website - knowstar.org/
Instagram - / learn.knowstar
Facebook - / knowstartrainings
Linkedin - www.linkedin.c...
Email - learn@knowstar.org

Опубликовано:

 

26 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 25   
@jomeks5031
@jomeks5031 2 года назад
Hi. What if i want to set to null the moving average with not enough rows... Like in your example the first two rows?
@LearnatKnowstar
@LearnatKnowstar Год назад
This is a great question. Thank you for mentioning this scenario. You can use RowNumber function to calculate the Row Numbers and start the calculation only from the 3rd row. You can use CASE or IFF to perform this check - Please see example below - IIF(ROW_NUMBER() OVER(PARTITION BY FA.CurrencyKey ORDER BY DateKey)>=3,AVG(EndofDayRate) OVER (PARTITION BY FA.CurrencyKey ORDER BY DateKey ROWS BETWEEN 2 PRECEDING AND CURRENT ROW) , NULL) AS _3DAYROLLINGAVG
@terryh558
@terryh558 2 года назад
Good job on your videos. I keep looking for more! As to the Moving Average of a Stock or Currency a) it should not start computing anything until you have number of days = moving average length, b) you do NOT want to fill in missing dates because (barring data errors) those are days when the market is closed like Sat/Sun/Holidays. Those days are just ignored. We could row_number the data, oldest data first, and use that to put NULL into the first 13 days if your MA length = 14. I seem to recall seeing a graphing feature in SSMS. If so, I'd like to see how to put this same data into a graph.
@LearnatKnowstar
@LearnatKnowstar 2 года назад
Thank you for sharing this. These insights really help all of us learn and grow. 👍
@payalia08
@payalia08 10 месяцев назад
Just got this task for my job thanks in advance😄
@LearnatKnowstar
@LearnatKnowstar 10 месяцев назад
Hope it helped
@vpnath75
@vpnath75 2 года назад
Very informative! I would also be interested in seeing an explanation for the exponential moving average. Thanks!
@LearnatKnowstar
@LearnatKnowstar 2 года назад
Thank you. We will posting the video in exponential rolling average soon 👍
@samuelfsdev
@samuelfsdev 2 года назад
It's a greate content! These videos reawaken my interest in database management.
@LearnatKnowstar
@LearnatKnowstar 2 года назад
Glad these are useful. Thanks 🙏
@varshadeore154
@varshadeore154 9 месяцев назад
thanks.. very helpful
@LearnatKnowstar
@LearnatKnowstar 9 месяцев назад
Thank you
@diydecor2653
@diydecor2653 2 года назад
Simple and easy to understand
@LearnatKnowstar
@LearnatKnowstar 2 года назад
Thank you 🙏
@kristyowens2284
@kristyowens2284 2 года назад
Once again great explanation. Thanks!
@LearnatKnowstar
@LearnatKnowstar 2 года назад
Thank you 🙏
@amukelaniebenezer406
@amukelaniebenezer406 Год назад
Thank you.
@aduvalasatheeshkumar4840
@aduvalasatheeshkumar4840 2 года назад
Great Explanation...! Can you tell me a logic to get the previous row value if the curent row field is empty. Thanks ...!
@LearnatKnowstar
@LearnatKnowstar 2 года назад
Thank you. You can get previous rows with lag function. If the row is entirely missing, you would first need to create a dummy record for the missing row.
@nikolaybaranov2213
@nikolaybaranov2213 2 года назад
Thanks, very helpful!
@LearnatKnowstar
@LearnatKnowstar 2 года назад
Thank you 🙏
@VinayKumar-lb3lq
@VinayKumar-lb3lq 2 года назад
Hi, can u pls make videos on recursive querys from start to end.
@LearnatKnowstar
@LearnatKnowstar 2 года назад
Yes sure. We are planning a series on SQL/DB concepts soon and these topics will be covered there. 👍
@mainlykanchan8740
@mainlykanchan8740 2 года назад
Ma'am will you please solve leetcode queries?
@LearnatKnowstar
@LearnatKnowstar 2 года назад
Sure. We are planning soon 👍
Далее
SQL Tricks | How to find value in multiple columns ?
13:09
Oh No! My Doll Fell In The Dirt🤧💩
00:17
Просмотров 2,8 млн
What is ETL | What is Data Warehouse | OLTP vs OLAP
8:07
Database Indexing for Dumb Developers
15:59
Просмотров 53 тыс.
SQL Index |¦| Indexes in SQL |¦| Database Index
9:57
Computing rolling average in DAX
16:43
Просмотров 72 тыс.