Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Definition of SpreadSheet Schema #22

Closed
azu opened this issue Mar 12, 2021 · 9 comments
Closed

Definition of SpreadSheet Schema #22

azu opened this issue Mar 12, 2021 · 9 comments
Labels
Status: Proposal Request for comments Type: Documentation Documentation only changes Type: Refactoring A code change that neither fixes a bug nor adds a feature

Comments

@azu
Copy link
Owner

azu commented Mar 12, 2021

The user can edit their own spreadsheet directly.
So, we should provide spreadsheet schema.

The user can know that what cell can be edit or not.

@azu azu added Status: Proposal Request for comments Type: Documentation Documentation only changes labels Mar 12, 2021
@azu
Copy link
Owner Author

azu commented Mar 19, 2021

Option 1: per year sheet

currently, spreadsheet has a sheet per year.

props

  • can have a budget per year

cons

  • complex logic
  • especially, create a new record by subscription

Option 2: all data in a single sheet

props

  • simple
  • easy to calculate the sum of all records

cons

  • can not have a budget per year

@azu
Copy link
Owner Author

azu commented Mar 19, 2021

options 2: all data in a single sheet

=SUMIFS(C:C,A:A,"2021-*") can calculate date by year.

@azu
Copy link
Owner Author

azu commented Mar 19, 2021

If we can record the history of budge in option 2, we can select option 2.

@azu
Copy link
Owner Author

azu commented Mar 19, 2021

image
Budget Sheet is reasonable for me.

@azu
Copy link
Owner Author

azu commented Mar 19, 2021

Ok. I figure out!

Example

https://docs.google.com/spreadsheets/d/1We_196wyVdIu2Kttt4eHaqIfmS-86SWUMN7DsW8DfiI/edit?usp=sharing

Change

  • Rename 2021 sheet to Record (bike sharing name)
  • Create Budget sheet and move current budge to Budget sheet

Budget Schema

Year Budget Used Balance
2020 ¥200,000.00 ¥0.00 ¥200,000.00
2021 ¥200,000.00 ¥337,861.02 -¥137,861.02

Budget sheet formula

  • Year is manual input(2020, 2021 ...)
  • Budget is manual input
  • Used refer Record sheet via =SUMIFS('Record'!C:C,'Record'!A:A,INDIRECT(ADDRESS(ROW(),COLUMN()-2))&"-*")
  • Balance refer Record sheet via =INDIRECT(ADDRESS(ROW(),COLUMN()-2))-INDIRECT(ADDRESS(ROW(),COLUMN()-1))

Record sheet formula

  • Budget to be =IFERROR(Index(QUERY(Budget!A:B, "select * where A = "&YEAR(TODAY()), 0),1,2), 0)
  • Used to be =SUMIFS(C:C,A:A, YEAR(TODAY())&"-*")
  • Balance to be =A2-B2

📝 If a budget of current year is missing, Budget show 0.

Note

  • This design aim to reduce create sheet task suddenly
    • "Option 1" need to create new sheet when input new record. We want to avoid it
  • This design get aim to human readable and machine readable
    • Separated definition help us to use
  • A single Record sheet easy to introduce subscription sheet Add subscription type like monthly? #8
    • Option 2 is simple by the reasone
  • ⚠️ careful recursive reference

@azu azu added the Type: Refactoring A code change that neither fixes a bug nor adds a feature label Mar 19, 2021
@azu azu changed the title Definition SpreadSheet Schema Definition of SpreadSheet Schema Mar 20, 2021
@azu azu pinned this issue Mar 20, 2021
@azu
Copy link
Owner Author

azu commented Mar 20, 2021

Step

@azu
Copy link
Owner Author

azu commented Apr 4, 2021

@azu
Copy link
Owner Author

azu commented Apr 4, 2021

After migration and we need to add docs

@azu
Copy link
Owner Author

azu commented Apr 8, 2021

Now, new schema.
We will continue to write docs #37

@azu azu closed this as completed Apr 8, 2021
@azu azu unpinned this issue Apr 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Proposal Request for comments Type: Documentation Documentation only changes Type: Refactoring A code change that neither fixes a bug nor adds a feature
Projects
None yet
Development

No branches or pull requests

1 participant