Use eval-data macro to sum based on a specific column value

II would like to sum a number using the eval-data macro in one table based on the values in another table. The issue I have is I want the eval-data macro to only include values based on the value of another column.

In the example below, I have a table called “Days Earned”. The second table is called “PTO Details” with one column called DaysUsed and another called PTOEmp.

Is there a way I can use in the eval-data macro in “Days Earned” but only sum DaysUsed when Days Earned:Employee=PTO Details:PTOEmp. Basically this would allow me to total the days used by each employee and show that number in another table.

{noformat}
{table-data:Days Earned}
|| Employee|| Start Date || Day Earned || Days Carried Over ||
| {list-data:Employee|required=true}
{user-options:groups=confluence-users|sort=ascending} {list-data} | {date-data:StartDate|format=MMM-dd-yyyy}{date-data} | {number-data:DaysEarned}17{number-data}| {number-data:DaysCarOver}0{number-data}|
{table-data}

{table-data:PTO Details}
|| Employee|| PTO Date || Reason|| Days Used ||
| {list-data:PTOEmp|required=true}{user-options:groups=confluence-users} {list-data} | {date-data:PTO Date|format=MMM-dd-yyyy}today{date-data} | {list-data:Status}{list-option}Sick Day{list-option}
{list-option}PTO Day{list-option}{list-data} | {number-data:DaysUsed}1{number-data}|
{table-data}

{noformat}
 
sad I’m confused
Inappropriate?
1 person has this question

User_default_medium