SmartQueryTools

Add Moving Average to Parquet Files Online

Add a moving average, rolling sum, rolling min, or rolling max column to Parquet files directly in your browser. Choose window size, order-by column, and optional partitioning — no upload required.

How to add Moving Average to Parquet files

  1. Drop your file onto the upload area. It is loaded into the in-browser engine and the first 200 rows are shown.
  2. Pick a window function: Moving Average (the default), Rolling Sum, Rolling Min or Rolling Max. The output column name changes to match, for example moving_avg or rolling_sum.
  3. Choose the value column (numeric columns only) and the window size in rows. The default is 3, and the window is the current row plus the rows before it.
  4. Choose an Order by column, usually a date, and optionally a Partition by column so each group gets its own series. Click Add Rolling Column.
  5. Check the preview, then download the file in the same format you uploaded.

Your file is processed locally in your browser and is never uploaded. The free limit is 50 MB per file; larger files work if your device has the memory for them.

Worked example

A café tracks cups of coffee sold each day. Daily figures jump around with the weather, so the owner wants a 3-day moving average to see the underlying trend.

Input (Parquet)

Parquet file (binary, columnar) — shown as a table with its schema

sale_dateweekdaycups_sold
2026-05-04Mon120
2026-05-05Tue150
2026-05-06Wed90
2026-05-07Thu180
2026-05-08Fri210
2026-05-09Sat150

Schema: sale_date DATE, weekday VARCHAR, cups_sold BIGINT

Settings

  • Window function: Moving Average
  • Value column: cups_sold
  • Window size: 3 rows
  • Order by: sale_date
  • Partition by: (none)
  • Output column name: moving_avg

Result

sale_dateweekdaycups_soldmoving_avg
2026-05-04Mon120120
2026-05-05Tue150135
2026-05-06Wed90120
2026-05-07Thu180140
2026-05-08Fri210160
2026-05-09Sat150180

From Wednesday on, each value averages that day and the two before it: Thursday is (150 + 90 + 180) / 3 = 140. Monday and Tuesday do not have two earlier rows, so they average what is available: 120 alone, then (120 + 150) / 2 = 135. They are not left empty. Wednesday's dip is smoothed to 120, and the upward trend from Thursday is easy to see.

Working with Parquet files

Parquet is a common home for sensor and metrics time series, often with many devices in one file. Set Partition by to the device or entity column so each one gets its own rolling series. Otherwise readings from different devices are averaged together. Timestamps order at full microsecond precision. With duplicate timestamps within a device, the order between those rows is not fixed.

The output type depends on the function. Moving Average always gives DOUBLE. Rolling Min and Rolling Max keep the source column's type. Rolling Sum of a DOUBLE stays DOUBLE. Rolling Sum of an INT32 or INT64 column is computed as a 128-bit integer and written to Parquet as DOUBLE. The window can be up to 1,000 rows. All other columns and their types are written unchanged, but rows may come back grouped by the partition column. Readings stored inside a struct column must be pulled out to a top-level column before they can be smoothed.

Frequently Asked Questions

How do I compute a rolling average per sensor in a Parquet file?

Choose the timestamp column as Order by and the sensor ID column as Partition by. Each sensor then gets its own series, and its window never reaches into another sensor's readings.

What Parquet type does the rolling column get?

DOUBLE for Moving Average. Rolling Min and Max keep the source type. Rolling Sum gives DOUBLE, including when the source is an integer column.

How are the first rows handled when the window is not full yet?

They use whatever rows are available. With a window of 7, row 1 averages 1 value, row 2 averages 2, and from row 7 on every value covers 7 rows. No row is left empty for this reason.

Is the window centred or trailing?

Trailing. It covers the current row and the rows before it, up to the window size. Centred windows and exponential moving averages are not offered. Use the SQL Query tool with a custom window frame for those.

What is the difference between the four window functions?

Moving Average gives the mean of the window, Rolling Sum the total, and Rolling Min and Rolling Max the smallest and largest values. All four use the same window size, order and partition settings.

Related Tools

Round Numbers in Parquet Files Online

Round numeric columns in Parquet files to any number of decimal places directly in your browser. Set precision per column with a simple slider — no upload required.

Add Lag / Lead Column to Parquet Files Online

Add a LAG or LEAD column to Parquet files to shift any column forward or backward by N rows. See previous day's sales, next value in a sequence, or any time-shifted comparison — runs entirely in your browser.

Truncate Dates in Parquet Files Online

Truncate date and timestamp columns in Parquet files to a chosen precision — year, quarter, month, week, day, hour, or minute — directly in your browser. Rounds timestamps down to the start of each period. No upload required.

Add Moving Average to CSV Files Online

Add a moving average, rolling sum, rolling min, or rolling max column to CSV files directly in your browser. Choose window size, order-by column, and optional partitioning — no upload required.

Add Moving Average to Excel Files Online

Add a moving average, rolling sum, rolling min, or rolling max column to Excel files directly in your browser. Choose window size, order-by column, and optional partitioning — no upload required.

Add Moving Average to JSON Files Online

Add a moving average, rolling sum, rolling min, or rolling max column to JSON files directly in your browser. Choose window size, order-by column, and optional partitioning — no upload required.

Parquet Viewer Online

View and inspect Parquet files directly in your browser. Browse rows, check column names and data types — no upload required, your data stays on your device.

Convert Parquet to CSV Online

Convert Parquet files to CSV format directly in your browser. No upload required — your data never leaves your device.