SQLTeam.com | Weblogs | Forums

Calculate a current row value depending on the previous and next values

Hello again, @JeffModen!
Oh yes, I've read about 'Tally Tables'! They are really useful for such specific tasks as, if I'm not mistaken, generating a sequence of numbers and dates with some 'step' like 0.1 or 1 date for example. They are really cool :slight_smile:
Thank you a ton for spending your well-deserved rest time on my task!
First thing tomorrow at work I'll try to run your code and write here after that. Thanks a lot again!

@JeffModen, hello again!
I tried your code and it works really good! Thanks a lot one more time!
Can I ask one more question please? What if I need not just smoothed linear interpolation but also simple average for the same date but for the other value? Only the formula for the InterpolatedVal calculation will change or parameters like GrpNum, CurGrpVal, etc. will need to be changed too?