Forum Discussion
Calculate Net Working Days from dates in two different tables
- 3 years ago
Hi,
This calculated column formula in the ALL FYs table works
Column = LOOKUPVALUE('Perf metrics'[Contract Signed Date],'Perf metrics'[(PR) PR No.],'all Fys'[(PR) PR No.],'Perf metrics'[(PR) PR Item No.],'all Fys'[(PR) PR Item No.])Hope this helps.
- 3 years ago
Hi,
That error message means that there are duplicate entries appearing in the PR_REF_NO column of the System PR table.
Hi it's me again!
My code is:
| Perf Metrics Table(relevant columns) | |||
| PR No | PR Item No | PR Ref | Contract Signed Date |
| PM22001 | 1 | PR-12345 | 5/5/2022 |
| PM23002 | 1 | PR-67890 | 4/6/2022 |
| PM21056 | 2 | PR-11121 | 7/7/2022 |
| System PR table | |||
| PR_REF_NO | START_DATE | ||
| PR-12345 | 4/4/2022 | ||
| PR-67890 | 4/5/2022 | ||
| PR-11121 | 3/6/2022 |
Hi,
That error message means that there are duplicate entries appearing in the PR_REF_NO column of the System PR table.
- shermayne1233 years agoHelper I
Hi Ashish,
Thanks for your enlightening advice.
I've checked and found that there were indeed duplicates of PR_REF_NO as there were more than one START DATE for some of the PR_REF_NO. I further confirmed that we can use the latest date if this occurs. However, after sorting both the PR_REF_NO and the START DATE, I am at a loss how to extract only the correct date. I tried to use the conditional column method, but there seems to be no way to indicate this condition here. Is it possible to do a if-else condition whereby if PR_REF_NO is duplicated, only extract the later date of whatever number of Start Dates available for each of this non-unique PR_REF_NO?
Thanks so much for helping with this!
- Ashish_Mathur3 years agoSuper User
Hi,
Share some data and show the expected result.
- shermayne1233 years agoHelper I
Hi Ashish,
While waiting I thought of a method i.e. to delete the duplicate records with the earlier start dates , by sorting the PR_REF_NO in ascending order and START DATE in descending order, assuming the software will delete the second record which has the earlier date, but it deleted the later date instead. When I resort it by ascending order, it will delete the second record with the later date and keep the first one with the earlier date. So this method doesn't work.
Below is my table and the expected result in column "Selected Start Date":
System PR table PR_REF_NO START_DATE Selected Start Date PR-12345 4/4/2022 record to be deleted PR-12345 5/5/2022 5/5/2022 PR-67890 3/3/2022 record to be deleted PR-67890 4/5/2022 4/5/2022 PR-11121 3/6/2022 3/6/2022 PR-14589 6/6/2022 6/6/2022 Hope you can help, thanks!!