Country name of destination

I read this thread because the title stirred up some anger in me about addresses lol.

Recent conversation I had:

  • Plant controller: Can you give me a list of invoices for the last X months.
  • Me. No problem, here you go.
  • Controller: Can you add the ship-to address
  • Me: :man_facepalming: :angry: :sob:

I’d love to be corrected, but addresses are just a nightmare with orders/shipments/invoices.

Here’s the BAQ I made:

Then 6 calculated fields like this:

image

And the 7th - country - being the oddball:

image

This is what everyone has been saying basically, but to put it all together:

  1. If the order has a “one-time ship-to,” then the address info is on the OrderHed table
  2. If the order has a ship-to selected, you need the ShipTo table for the data
  3. If you have no ship-to selected and it is not a “one-time ship-to” … you actually do have a ship-to - its ID is "" [empty string].
    a. (You can ignore this advice; it’s covered by #2.)
  4. City is free text in 1 and 2
  5. So is State/Province, ZIP, etc.
  6. But Country is text in the ShipTo table and an integer in the OrderHed table.
    a. Thus you need to join in the Country table for the sake of one-time ship-to.