Counting/ Rollup Certain Values within a relation field

Hi Everyone!

I am currently working on a maintenance app for a manufacturer. One part of the app is that you can log maintenance call out to a machine, should it be down and need fixing. Each call out is is related to a machine and they each have their own dedicated table.

The question/ issue I am having is that I am wanting to create a roll up from the relation field based on the status of the call outs (Ongoing, On Hold, Completed) so that when you are viewing a machine within pages you can see a history/ breakdown of call outs in numbers for example 10 completed call outs, 1 on hold, 2 ongoing etc.

Hope I did a good enough job of explaining my issue! Thanks in advance for you help :slight_smile:

each record of the call needs to have a machine row ID… then add an if-else column to filter out selected machine status, then other if-else columns to filter out any other info you need.

This doesn’t sound right. You will probably be better off down the road if all call-outs are in one table, and all machines are in another.

Hi Nathan! I probably didn’t explain this well :sweat_smile: but yes, they are in separate tables, so one table for call outs and another table for all machinery

1 Like

Hi Uzo! Thanks for your reply! How does using the Machine Row ID differ from using the name in the relation field? I have tried before using the if-else on the relation field to try and give me some values per status that can be rolled up, but I have had no luck :confused: is there any chance you could give me some more detail on how I could go about doing this more effectively? Thanks again!

Hola!

The trick here is create a template which joins the machine name (or ID) and its status in both tables and later, create a relation in order to use a Rollup.

but nothing better than a image…

  1. You should have a data table like this

image

  1. and I would have another table where all machines and their status are declared. Here is where we make the stats (what you want) and created the relation. Of course, all of this can be done dynamically by creating a screen and the user choosing the machine and state to search for.

I hope it helps you.

Saludos!

1 Like