Use case:
- A table of items, each with a name and amount.
- Let’s say I want a screen to display a collection or table of these items and below it the sum of the amounts.
- This use case would be useful for inventories, budgets, accounting, finances, etc.
Name | Amount |
---|---|
Item1 | $1 |
Item2 | $2 |
Item3 | $3 |
SUM: $6
How would you set this up?
Layout editor
Let’s use the following components: a New Table and a Big Numbers (New Table and Text components would be fine too).
Data editor
Here is where my question lies. How would you set up your tables? I’m curious to see how others do it and why.
Ideally, here are elements I’m looking for:
- Modularity / Adaptability: what data structure will be the most solid long term.
- Cleanliness: what data structure would be considered clean (respecting normal form)
- Simplicity: what data structure reduces complexity
Here are a few options I see
Option A (1 table)
A single Items table only. The items and rollup sum are in the table. The table is the data source of the screen.
Option B (2 tables)
A table of items. An item helper table for the rollup sum. The item helper table is the data source of the screen.
Option C (2 tables)
A table of items. An “All tabs” table as the data source for all screens. The rollup sum in this “All tabs” table.
Option D (3 tables)
A table of items. An “All tabs” table as the data source for all screens. An item helper table for the rollup sum. A single value column in this “All tabs” table to pull the rollup sum.
Option E (using the Users table)
Put the rollup sum in the Users table.