Need help with Enemlist and select

Hi,

I have 2 tables named Solutions and Packages
Solutions

  • SolutionID–Key
  • Solution Name -text
  • selected packages - enumList ( this is ref to Packages Table) users can add multiple packages to this column
  • Last updated - time

Packages table

  • PgkID
  • Package Name
  • Package Description
  • Role 1 -text
  • Role 1 hrs - decimal
  • Role 2 -text
  • Role 2 hrs – decimal
  • Role 3 -text
  • Role 3 hrs – decimal

in the Solution table I have a VC that calculate total hrs for each role for the added packages
Example if a user add 3 packages and each can have multiple roles added

  • package 1 — role 1 -->1 hr , role 2–>3 hrs and role 3—>0 hrs
    Package 2 — Role 1–>0hr , role 2 -->1hr ad role 3 -->2 hrs
    Package 3 — Role 1 → 2hrs. , role 2 – 0 hrs and role 3 -->1hr

in VC-role1 – i like to add (package 1 — role 1hrs) +)Package 2 — Role 1hrs) +(Package 3-role 1 hrs = 3hrs

Any help how to do this in Appsheet would be appreciated

sum(select(Packages[Total Role1 Hours],IN([_THISROW].[selected Packages],Packages[Row ID])))

I try with this expression and it give me same value for all the packages

Try below for Role 1 hrs. This uses a List Dereference expression.

SUM([Selected Packages][Role 1 hrs])