Ubidots Developer Guides
Help CenterAPI ReferenceData APICommunity
  • Welcome to our Dev Guides
  • āš”ļø Getting Started
    • What is Ubidots?
    • Devices, Variables, and Dots
    • Technical FAQs
    • Business FAQs
  • 🧩Integration Guides
    • Industrial IoT
      • Advantech
      • Amplified Engineering
      • AWS
      • Azimut
      • Balena
      • Bivocom
      • CESVA
      • Controllino
      • Digital Communications Technologies (DCT)
      • Everactive
      • Golioth
      • Kepware
      • Kunbus
      • Monnit
      • MultiTech
      • NCD.io
      • Node-RED
      • Omicron IoT
      • Red Lion
      • Robustel
      • Senquip
      • Sielco
      • Siemens
      • Strega
      • vNode
      • WAGO
      • Weintek
      • YuDash
    • Cellular
      • Blues Wireless
      • Digi International
      • Hologram
      • Monogoto
      • Particle
      • Quectel
      • Soracom
    • LoRaWAN
      • AonChip
      • Chirpstack
      • Decentlab
      • Helium
      • ioThings
      • LORIOT
      • Milesight
      • MOKOSmart
      • RAKwireless
      • Sagemcom
      • Seeed Studio
      • Senet
      • The Things Industries
        • The Things Stack
        • The Things Network
    • Sigfox
      • Digital Matter
      • McThings
      • Sigfox
      • Suntech
      • Thinxtra
      • UnaBiz
    • Satellite
      • Swarm
    • Dev Kits
      • Adafruit
      • Advantech
      • AloriumTech
      • Arduino
      • Blues Wireless
      • DFRobot
      • Dragino
      • Electric Imp
      • Espressif Systems
      • McThings
      • Microchip Technology
      • Onion
      • Particle
      • Pycom
      • RAKwireless
      • Raspberry Pi
      • Seeed Studio
      • Sodaq
      • STMicroelectronics
      • Texas Instruments
      • Thinxtra
      • Verse Technology
    • Weather
      • Weather Plugins
      • Ambient Weather
    • Tools
      • Gambit Communications
      • PubNub
  • šŸ“ŠDashboards & Widgets
    • HTML Canvas
      • 3rd party packages
      • Preload Dashboard data
      • Built-in library
        • Properties
        • Methods
        • Listening events
        • API
      • Examples
        • Basics
        • Create an LCD screen with the HTML Canvas
        • Interacting with dashboard data
        • Change header's custom style
        • Adding real time using Socket.IO
        • Delete Variable data from a Device
        • Delete Variable data from Groups or Types of Devices
        • Navigation through Dashboard
        • Using a React library
      • Code editor
        • HTML Tab
        • CSS Tab
        • JavaScript Tab
    • Custom UI
      • Paragraph
      • Input combo
        • Text
        • Numeric
        • Numeric with buttons
        • Date
        • Time
        • Toggle
        • Dropdown
        • Multiple selection dropdown
      • Button
    • Custom Style
      • Dashboards
      • Widgets
    • Line chart
    • Pages
      • Getting started
      • Development
      • API
        • Page creation
        • Publish
  • šŸ¤–UbiFunctions
    • Getting Started
      • Creating an UbiFunction
      • Coding an UbiFunction
      • Testing an UbiFunction
      • Authentication
      • Execution Time
      • Logs
    • Runtimes
      • Python
      • NodeJS
      • Custom Runtimes
    • Invocation
      • Time-based Trigger
      • HTTPS
      • MQTT Publish
      • Ubidots Event
    • Advanced
      • Account Token
      • Execution time
      • Raw Functions
      • CORS Policy
      • Async Execution
      • DaaS (Decoder as a Service)
      • Developing and Managing UbiFunctions with Ubidots CLI
    • Examples
    • Specs and Limits
    • Storage
      • File Storage API
      • Mutiple files
  • 🧩Plugins
    • What is a plugin?
    • Public vs. Private
    • Public plugins
      • Cron
      • Webhook
    • Private Plugins
      • Cron
      • Webhook
      • Widget
      • Device
    • Plugins development
      • Getting started
      • Cron
      • Webhook
      • Widget
      • Device
      • view.xml
      • view_widget.xml
    • Plugins deployment
      • Cron and Webhook
      • Widget
      • Device
    • Using the plugins
      • Cron and Webhook
      • Widget
      • Device
  • šŸ“ˆSYNTHETIC VARIABLES
    • Getting started
      • Creating synthetic variables
      • Synthetic Variables' editor
    • Expressions
      • Mathematical
      • Date range
      • Rolling
      • Special functions
    • Specs and limits
    • Examples
      • Mathematical
      • Date range
      • Rolling
      • Special functions
  • āŒØļøDeveloper tools
    • Javascript SDK
      • Overview
      • Getting started
      • Ubidots class
        • Get methods
        • Filter methods
        • Ubidots objects
          • Entity object
          • Paginator
      • Examples
    • CLI
      • Overview
      • Installing
      • Usage
      • SDK for UbiFunctions
  • šŸ—ļøApps
    • App builder
      • Custom sidebar
Powered by GitBook
On this page

Was this helpful?

Export as PDF
  1. SYNTHETIC VARIABLES
  2. Examples

Date range

PreviousMathematicalNextRolling

Last updated 6 months ago

Was this helpful?

Syntax
Example
Output

Assuming that values are sampled every second:

Assuming that values are sampled every hour:

Assuming that values are sampled every minute:

Assuming that values are sampled every minute:

Assuming that values are sampled every day:

Assuming that values are sampled every month:

Assuming that values are sampled every month:

Assuming that values are sampled every minute:

šŸ“ˆ
max(x,range)max(x, range)max(x,range)
max([1,2,3,āˆ’1],"T")max([1, 2, 3, -1], "T")max([1,2,3,āˆ’1],"T")
333
min(x,range)min(x, range)min(x,range)
min([1,2,3,āˆ’1],"4H")min([1, 2, 3, -1], "4H")min([1,2,3,āˆ’1],"4H")
āˆ’1-1āˆ’1
mean(x,range)mean(x, range)mean(x,range)
mean([1,2,3,0,āˆ’1],"5T")mean([1, 2, 3, 0, -1], "5T")mean([1,2,3,0,āˆ’1],"5T")
111
std(x,range)std(x, range)std(x,range)
std([1,2],"T")std([1, 2], "T")std([1,2],"T")
0.7070.7070.707
count(x,range)count(x, range)count(x,range)
count([1,2,3,0,āˆ’1],"W")count([1, 2, 3, 0, -1], "W")count([1,2,3,0,āˆ’1],"W")
555
last(x,range)last(x, range)last(x,range)
last([1,2,3,0,āˆ’1],"4M")last([1, 2, 3, 0, -1], "4M")last([1,2,3,0,āˆ’1],"4M")
āˆ’1-1āˆ’1
first(x,range)first(x, range)first(x,range)
first([1,2,3,0,āˆ’1],"4M")first([1, 2, 3, 0, -1], "4M")first([1,2,3,0,āˆ’1],"4M")
111
sum(x,range)sum(x, range)sum(x,range)
sum([1,2,3,0,āˆ’1],"4T")sum([1, 2, 3, 0, -1], "4T")sum([1,2,3,0,āˆ’1],"4T")
555