Forum Discussion
Lookup values across two tables
- 5 years ago
I've solved my own problem. Cool! Here are the tables with the solution added. The key was to bring over a column from the lookup table so I could do calculations on it in this table. So, in InstructorQualfications, I added Units from the QualsFromUnits table. In TrainingProgress, I added Qualification from the QualsFromUnits table.
There might have been a more efficient way to do this, but this was what I found worked.
Suggestions, comments, feedback are welcome in an effort to teach me more stuff!
Table name: InstructorQualifications
Calculated columns:
Unit =
LOOKUPVALUE (
QualsFromUnits[Unit],
QualsFromUnits[Qualification], InstructorQualifications[Qualification]
)Unit Passed =
CALCULATE (
MAX ( TrainingProgress[Grade] ),
FILTER (
TrainingProgress,
TrainingProgress[Grade] = "S"
&& InstructorQualifications[Name] = TrainingProgress[Name]
&& InstructorQualifications[Unit] = InstructorQualifications[Unit]
)
)Table name: TrainingProgress
Calculated columns:
Qualification =
LOOKUPVALUE (
QualsFromUnits[Qualification],
QualsFromUnits[Unit], TrainingProgress[Unit]
)HasQualification =
CALCULATE (
MAX ( InstructorQualifications[Qualification] ),
FILTER (
InstructorQualifications,
TrainingProgress[Grade] = "S"
&& TrainingProgress[Name] = InstructorQualifications[Name]
&& TrainingProgress[Qualification] = InstructorQualifications[Qualification]
)
)
I've solved my own problem. Cool! Here are the tables with the solution added. The key was to bring over a column from the lookup table so I could do calculations on it in this table. So, in InstructorQualfications, I added Units from the QualsFromUnits table. In TrainingProgress, I added Qualification from the QualsFromUnits table.
There might have been a more efficient way to do this, but this was what I found worked.
Suggestions, comments, feedback are welcome in an effort to teach me more stuff!
Table name: InstructorQualifications
Calculated columns:
Unit =
LOOKUPVALUE (
QualsFromUnits[Unit],
QualsFromUnits[Qualification], InstructorQualifications[Qualification]
)
Unit Passed =
CALCULATE (
MAX ( TrainingProgress[Grade] ),
FILTER (
TrainingProgress,
TrainingProgress[Grade] = "S"
&& InstructorQualifications[Name] = TrainingProgress[Name]
&& InstructorQualifications[Unit] = InstructorQualifications[Unit]
)
)
Table name: TrainingProgress
Calculated columns:
Qualification =
LOOKUPVALUE (
QualsFromUnits[Qualification],
QualsFromUnits[Unit], TrainingProgress[Unit]
)
HasQualification =
CALCULATE (
MAX ( InstructorQualifications[Qualification] ),
FILTER (
InstructorQualifications,
TrainingProgress[Grade] = "S"
&& TrainingProgress[Name] = InstructorQualifications[Name]
&& TrainingProgress[Qualification] = InstructorQualifications[Qualification]
)
)