App script to transform columns of months

31 views
Skip to first unread message

Reza Azmi

unread,
Jan 27, 2023, 5:56:17 AM1/27/23
to Google Apps Script Community
Hi,

Need some help to develop a script that will be able to summarize data (Column of values for a given month) for each member (in rows).

My sheet looks like this.

Screenshot 2023-01-27 at 18.47.32.png
I am trying to copy from one sheet to another, but I want the data for months to be summed for all years beginning from 2014 all the way to the end of the columns (last year or latest month-year entry). We keep adding to this sheet. 

Ideally .... we should end up with:

Member Information XXX |  2014 | Entries for 2014 | 2015 | Entries for 2015 etc
Member X  ....
Member Y....
Member Z ....

I am still struggling to understand the way to logically structure the script to make this happen. I can copy and paste the data with a script (my current level!).

Any suggestions or tips? 

Thanks 

Reza

laurie.nason

unread,
Jan 29, 2023, 12:42:37 AM1/29/23
to google-apps-sc...@googlegroups.com
Dear Reza,
Unfortunately the screenshot you have shared does not provide enough information for me to make any real suggestions to solve your problem - can you create a dummy data sheet that you share with us so that we can get a better idea of what you want to achieve?
From what you have provided, it sounds like you can probably achieve this using the native GoogleSheets formulas, without having to resort to scripting, but without more info, that’s tricky to suggest anything either.


------ Original Message ------
From "Reza Azmi" <ray...@gmail.com>
To "Google Apps Script Community" <google-apps-sc...@googlegroups.com>
Date 1/27/2023 1:56:17 PM
Subject [Apps-Script] App script to transform columns of months

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/56ccd7f5-8d37-4274-a113-5c875d05be42n%40googlegroups.com.

Reza Azmi

unread,
Jan 29, 2023, 9:32:01 PM1/29/23
to Google Apps Script Community
I think I solved the main part of this as I found a solution here: 
https://www.youtube.com/watch?v=ea7jjOHHiOw

I can now at least "unpivot" my table and now have a data table i can work from. 

Cheers,

Reza

Reply all
Reply to author
Forward
0 new messages