Hello. I have multiple tables (Pack A, Pack B, Pack C etc.)
Each of those tables has HOURS column and at the bottom of that column there’s a sum of all the hours of the rows.
Apart from these, I have one other table called PACK Hours which has two columns: Pack Name, Total Hours. In each row of this table the cell under Total Hours column should show the sum of HOURS column in the table referenced in Pack Name column.
And the best way may to combine all of the different packs into one large table and just label them in another column called Pack Name. Then you can do:
If I understand your actual setup correctly (see the very first sample below ) you’ll need to use a SwitchIf() formula in your table Pack where you wish to Sum() the hours depending on the Pack in your field [Pack Name] such as :
In other words this kind of says, if thisRow.Name ="Pack A" then, sum the values in the field hours for the table [Pack A], if thisRow.Name ="Pack B" then, sum the values in the field hours for the table [Pack B]
You’d need to do this for all the tables [Pack x] you have …
Now, another possibility which would require some modifications to your setup but maybe you could use one table to list the various packs and another table with the details for those packs …
The first table would be linked to the second one using a lookup field allowing you to select the concerned pack … All you would have to do to get the sum of the hours in the first table would be to gather back the rows from the second table and then sum the hours
Thanks @Pch ! Yes, you got it right in the first example.
Yes, switch option works, but sorry that I forgot to mention this: The number of Pack X tables is not known. And adding a new condition to the formula every time a new Pack X table is created is not comfortable. So, is there a way that I can get the name of table from the Name column of the current row ? I’ve tried [thisRow.Name].Hours but it doesn’t work
With the second suggestion I’ve made, even though I know you’d need to adapt your current doc, you really wouldn’t need to modify the SwitchIf() when adding a new pack (or even use SwitchIf() for that matter ).
From the table “Pack details”, where each row would be linked to a pack from the “Summary” pack table, you could create filtered views (1 Pack, 1 view) and still use those views to add hours and other info … The sum would be automatically updated in the “Summary” pack table …