reference a data source in a text field

i have a table show below and i would want the sum of 'days requested' column based on the 'type of leave' to get the total days requested example: the calculated value of the number field = 33 where the 'type of leave' = 'sickleave'.

I tried accessing the data source to query it but have no idea where to start. any help will be appreciated

1 reply