Deals Under the Holding Company

Advanced

Globex runs its regional businesses as child accounts under a holding company account. The group CFO wants every deal booked by those regional accounts.

Return each Opportunity's Name and its account's name (Account.Name) where the account's parent account is named Globex Holdings.

Sample data

Account 5 records

NameParent
Globex Holdingsnull
Initech Groupnull
Globex IndiaGlobex Holdings
Globex JapanGlobex Holdings
Initech LabsInitech Group

Opportunity 4 records

NameStageNameAmountCloseDateAccount
India renewalProspecting40,000today + 30 daysGlobex India
Japan pilotQualification25,000today + 30 daysGlobex Japan
Labs upgradeProspecting18,000today + 30 daysInitech Labs
Holding directProspecting90,000today + 30 daysGlobex Holdings

Expected result on the sample

NameAccount.Name
India renewalGlobex India
Japan pilotGlobex Japan

Row order does not matter. Only the columns above are compared; extra columns in your SELECT are fine.

Hints
  • An Account's parent account is Parent.
  • From Opportunity: Account.Parent.Name.

What this tests

Dot notation can climb more than one level: Account.Parent.Name goes from the deal to its account and then to that account's parent, up to five levels. Filtering on the account name instead catches the holding company's own deals and misses regional accounts with different names.

SOQL

Run on sample executes your query against the sample data shown on the left and displays the rows it returns. Submit checks it against the sample plus 2 hidden datasets, comparing your rows with the expected rows on each. Queries run in a real Salesforce org; the data is inserted for your run and rolled back afterwards.