Tuesday, January 22, 2013

yogi_Pull In Records From Log-File That Are No Older Than Specified Number Of Days

                                          Google Spreadsheet  Post  #985
Yogi Anand, D.Eng, P.E.      ANAND Enterprises LLC -- Rochester Hills MI     www.energyefficientbuild.com.    Jan 22, 2013
user Stente said:(http://productforums.google.com/forum/?zx=498o8ekdutdo#!category-topic/docs/spreadsheets/orZbnTKPUWI)
Solution to auto-hiding rows
Win7 & Google Chrome 24
_________________
Hey guys

Below is a short introduction, if you wanna skip that and go straight to the answer, you can look after the headline "QUESTION"

Introduction
I need some help(surprise!).
I have a sheet like this(this is a public copy);

It has a couple of tabs with different sheets that serves different purposes.
In general, it is a sheet to keep track of donations/withdrawals into a shared storage in a game.

However, after a a couple of months time, this sheet is populated by more than 1000 rows of inputs, which is a bit much to scroll through.
Which is why I have started using the "Hide rows"-function in the sheet - now we're getting closer to my question!

I would like this sheet to require minimal service/maintenance, so what I'm wondering is:

Question
Is there a way (scripting, built-in function etc.) to make the sheet automatically hide entries(based on the timestamp) older than fx. 7 days?

I currently have a script in the sheet, which I have constructed from bits and pieces of other scripts, since I'm no pro with scripting. This script is triggered by "onFormSubmit", so I was wondering if it was possible to do something like this for the sheet:

For all rows
OnFormSubmit 
IF timestamp IS OLDER THAN 7days
THEN HideRow

I know the above is not written in correct syntax and/or terms, but it's just go give you an idea of the desired functionality. And yes, I know it's not much of a job to go in and manually hide the rows each day/once a week, but it's just as much to learn some scripting as it is to ease my everyday :)

--------------------------------------------------------------------------------------
following is a formula based solution to a bit more generalized problem