Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8319701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T22:24:20+00:00 2026-06-08T22:24:20+00:00

I have data polling every x hours and it is based on a liquid

  • 0

I have data polling every x hours and it is based on a liquid level. The level always rises.

I need to know how to work out the average increase over a week (per day).

So if days data reads 1000-1200-1300-1400 then we know the average increase is 100 per day.

DateReceived  DeviceLevel Serial

1/mm/yyyy     3200         346
1/mm/yyyy     12000        222
2/mm/yyyy     3560         346
2/mm/yyyy     13600         222

Trying to use the

AVG()

function but to no evail.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T22:24:21+00:00Added an answer on June 8, 2026 at 10:24 pm

    You could use a self-join to find the level of the previous day. That gives you the increase for a day. An outer query could be used to find the average increase over a week:

    select  datepart(wk, Day) as WeekNr
    ,       avg(IncreasePerDay) as AverageDailyIncrease
    from    (
            select  cast(d1.MeasureDt as date) as Day
            ,       avg(d2.level) - avg(d1.level) as IncreasePerDay
            from    YourTable d1
            join    YourTable d2
            on      cast(d2.MeasureDt as date) = cast(d1.MeasureDt as date) + 1
            group by
                    cast(d1.MeasureDt as date)
            ) as SubQueryAlias
    group by
            datepart(wk, Day)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have data in Excel files that I am pulling out using the MS
We have a GWT based application deployed on Tomcat. Every other day the application
I have an XML document at a Url http://test.com/data.xml which I am currently polling
I have one worker role that throws data into around 10 queues that need
I have an INSERT query that is pulling data from two tables and inserting
I have 2 entities that are playing nice together when I am pulling data
I have the following linq expression pulling all data from my database: var items
I have an Entity Data Model that I have created, and its pulling in
I have a tableview with an image in each cell. I'm pulling the data
I have a query pulling the last six months of data from a table

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.