-
Notifications
You must be signed in to change notification settings - Fork 12
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
[2nd viz]: Data structure for visualization exploration: Is it possible to show the flow of inventory from one place to another over time? #878
Comments
Main goal: show the flow of inventory from one place to another over time Status quo
Caveat@aerinsol I'm exploring two options:
Stretch goalThe SQL query above can be adjusted to filter for box state changes in the history table: |
Conclusion: shadow tables are useful to determine the state of a table at a given point in time. On the contrary, finding out about actual change is cumbersome. Hence shadow tables are not helpful for the scenario above. Outlook: shadow tablesIt was proposed earlier to introduce shadow tables to the boxtribute database schema to enable more accurate tracking of historical data (mostly stock; also product, beneficiaries, products, locations, tags, qr).
|
Another user storyCan we use the current data structure of the history table for the following case: Data format of resultDimensions:
Facts
ImplementationWe expect that a basic SQL query could look like SELECT
GROUP_CONCAT(h.changedate) AS changedates,
GROUP_CONCAT(h.changes) AS allchanges,
s.id
FROM history h
INNER JOIN stock s ON (h.tablename = "stock" AND h.record_id = s.id)
WHERE h.change_date > T1 AND h.changes NOT LIKE "comments%"
) GROUP BY s.id; This results in a mapping of box IDs and history rows (i.e. changes). For each box ID we find out the change that has happened closest before D and is that is a location, product, or state change. Any potential changes that happened after D must be taken into account (possible change of items or change of product) in order to determine the properties of the box at D. ConclusionThe implementation above is complex, however it can be done in Python to avoid having to write complicated SQL. |
please checkout #950 for final decision |
Requirements:
Stretch goal:
Do a similar exploration but with
box_state.
The text was updated successfully, but these errors were encountered: