PaulStreit
5 years agoQrew Member
Calculating and charting monthly data from a total duration
I have a set of tasks where I have a start date, end date, calculated duration in months, and total labor cost for each task. A task can be years long. Labor costs are linearly prorated across the task duration. My goal is to be able to chart total labor costs for each month. I could create a dedicated field for each month, but that scales up quickly to a lot of fields if tasks run across a long time duration like 15 years.
I'm thinking instead that each month's labor cost has to be written to a record in a table. I know how to do that. My challenge is how to iterate through a task's duration to calculate a given month's labor costs, since in theory the application would start in the month and year of the task start, calculate the labor cost, write a record to the table, then go to the next month, repeat the cycle, and so on until the task end month is reached. In standard code a loop like this would be easy, but I'm not clear how to do this in the Quick Base environment. I've seen that a pipeline can iterate, but I think only as part of a search (query) of a set of records. I thought about having twelve tables, one for each month, and simply having fields for the labor cost and year, and then having twelve automations, one for each month, that would write the records to the appropriate table. Each of these month tables would be a child table to a parent tasks table, which would enable the rollup.
Am I on the right track or is there a better strategy?
Thank you,
Paul
------------------------------
Paul Streit
------------------------------
I'm thinking instead that each month's labor cost has to be written to a record in a table. I know how to do that. My challenge is how to iterate through a task's duration to calculate a given month's labor costs, since in theory the application would start in the month and year of the task start, calculate the labor cost, write a record to the table, then go to the next month, repeat the cycle, and so on until the task end month is reached. In standard code a loop like this would be easy, but I'm not clear how to do this in the Quick Base environment. I've seen that a pipeline can iterate, but I think only as part of a search (query) of a set of records. I thought about having twelve tables, one for each month, and simply having fields for the labor cost and year, and then having twelve automations, one for each month, that would write the records to the appropriate table. Each of these month tables would be a child table to a parent tasks table, which would enable the rollup.
Am I on the right track or is there a better strategy?
Thank you,
Paul
------------------------------
Paul Streit
------------------------------