Forum Discussion
Calculation from a lookup table with default
I have two tables, an aggregated table(AggrTbl) and another table (Lkup) is a lookup table. They are separate now but can be joined by Staff Name. I need help in calculating the Cost.
In the AggrTbl, I need to check if StaffName exists in Lkup table. If the StaffName exist, then i need to the corrosponding Rate. Then multiply Rate times AggrWklyHrs. If StaffName does not exist in Lkup table, then I have a default rate of 50. What formula should I use for Cost in the AggrTbl ?
- Anonymous7 years ago
Try something like this:
Cost =VAR varLookup =
LOOKUPVALUE (Lkup[Rate];
Lkup[StaffName]; AggrTbl[StaffName])
RETURN
IF (
varLookup <> BLANK();
varLookup;
50)
Regards
2 Replies
- AnonymousNot applicable
Try something like this:
Cost =VAR varLookup =
LOOKUPVALUE (Lkup[Rate];
Lkup[StaffName]; AggrTbl[StaffName])
RETURN
IF (
varLookup <> BLANK();
varLookup;
50)
Regards
- VHosamaneFrequent Visitor
Worked perfectly. Thank you so much.