Skip to main content
Question

Conditioning a GI using 2 Location Data Fields

  • June 19, 2026
  • 1 reply
  • 9 views

laurac19
Freshman I

The BAccounts in my system each have multiple locations.  I need the GI line results to have 1 line per BAccount and show the Location address information for the LocationCD =’Mailing’.  If there isn’t a LocationCD = ‘Mailing’, then I want it to show the location that is marked as “IsDefault”.  

 

Maybe it is better said, “If there is a location named “Mailing”, show that address.  If not, show the address for the location marked “Default”

 

What would be the best way to create this condition in my GI?  

1 reply

darylbowman
Captain II
Forum|alt.badge.img+16

Try this:

THINK the ‘MAILING’ condition will evaluate before the ‘IsDefault’ condition which should respect your escalation logic. If not, you’ll have to join two instances of Location, one on ‘MAILING’ and one on ‘IsDefault’, and an Address table on each, and then use an IIF statement to pick the correct address based on which ‘AddressID’ is not null.