Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

look up values for formula in another table by checking date is within start and end date

I have the following staff salary table called EmployeeSalaryTbl:

Staff Salaries

and a table called EmployersNIContributionTbl with the following tax information:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Tax

and I’m looking to create a formula to calculate the associated Employers NI Monthly based on their Salary Start Date that will replicate this pseudo code:

(Salary Monthly-Secondary Threshold) * Employers Contribution %

Where Salary Monthly is the row entry in EmployeeSalaryTbl and the Secondary Threshold and Employers Contribution % are from EmployersNIContributionTbl.

How would I go about finding the matching row from the employee start date where the start date is within the Tax Period Start Date and Tax Period End Date in the table EmployersNIContributionTbl?

>Solution :

In case the commented suggestion wasn’t enough, here’s another solution:

=([@[Salary Monthly]]-FILTER(EmployersNIContributionTbl[Secondary Threshold], ([@[Salary Start Date]]>=EmployersNIContributionTbl[Tax Period Start Date])*([@[Salary Start Date]]<=EmployersNIContributionTbl[Tax Period End Date])))*FILTER(EmployersNIContributionTbl[Employers Contribution %], ([@[Salary Start Date]]>=EmployersNIContributionTbl[Tax Period Start Date])*([@[Salary Start Date]]<=EmployersNIContributionTbl[Tax Period End Date]))
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading