Forum Discussion
How to get value from another table based on multiple criteria
Hello
I created following columns
In Quotations table -
1. Concat = Quotations[Branch] & Quotations[Department] & Quotations[Local Client] & Quotations[SrvLevel] & Quotations[Origin] & Quotations[Destination]
In Shipments table -
1. Concat = Shipments[Branch] & Shipments[Department] & Shipments[Local Client] & Shipments[Srv Level] & Shipments[Origin] & Shipments[Destination]
2. QuoteID =
IF(ISBLANK(LOOKUPVALUE(Quotations[Branch],Quotations[Concat],Shipments[Concat])),"",
CALCULATE(VALUES(Quotations[QuoteID]),
FILTER(Quotations,Shipments[Departure]>Quotations[Start Date] && Shipments[Departure] < Quotations[Expiry Date]),FILTER(Quotations,Quotations[Concat]=Shipments[Concat]) )
)
You might have to play with QuoteID field a little to replace "greater than" or "less than" with appropriate "greater than or equal to" or "less than or equal to"
It gives me correct results otherwise -
| QuoteID | Shipment ID | Origin | Local Client | Destination | Branch |
| SHP2800123 | KRPUS | Customer4 | DEBRV | BR2 | |
| SHP2800120 | NLRTM | Customer1 | DEBRV | BR2 | |
| SHP2800121 | NLRTM | Customer2 | DEBRV | BR2 | |
| SHP2800122 | DEHAM | Customer3 | DEBRV | BR2 | |
| SHP2800124 | KRPUS | Customer5 | DEBRV | BR2 | |
| SHP2800125 | CNSHA | Customer6 | DEBRV | BR2 | |
| SHP2800128 | CNSHA | Customer9 | DEBRV | BR2 | |
| QMT200002855 | SHP2800126 | DEHAM | Customer7 | DEBRV | BR2 |
| QMT200002856 | SHP2800127 | DEHAM | Customer8 | DEBRV | BR2 |
| QMT200002856 | SHP2800131 | DEHAM | Customer8 | DEBRV | BR2 |
| QMT200002858 | SHP2800129 | DEHAM | Customer10 | DEBRV | BR2 |
| QMT200002858 | SHP2800130 | DEHAM | Customer10 | DEBRV | BR2 |
Regards
- Anonymous8 years agoNot applicable
Hello Anonymous,
I've worked with your formula but still can't receive expected results. Please take a look at my file in below link and let me know what I am doing wrong.
many thanks in advance!