TCC – Subquery against another entity

So I was having to write an export that would mimic the results of and OBI report so that it could be automated. The logical entity to pull this information in was the application as it had candidate and requisition data that was needed for the report. Unfortunately, there was a filter in the OBI report saying that the requisition had to be posted. Now the problem here lies in the fact that you cannot access the SourcingRequest table from the application entity. So I’m like well, if I were writing this out, I would just make sure that:

ContestNumber in (select ContestNumber from SourcingRequest where PostingStatus = ‘posted’)

After monkeying around with it I finally got it to work and it’s done by putting in a subquery in the general filters:

<quer:filtering xmlns:quer="http://www.taleo.com/ws/integration/query">
	<quer:includedIn>
		<quer:field path="Requisition,ContestNumber"/>
		<quer:query projectedClass="SourcingRequest" alias="sqMotives" preventDuplicates="true" pagingsize="1">
			<quer:subQueries/>
			<quer:projections>
				<quer:projection>
					<quer:field path="Requisition,ContestNumber"/>
				</quer:projection>
			</quer:projections>
			<quer:filterings>
				<quer:filtering>
					<quer:equal>
						<quer:field path="SourcingRequestStatus,Number"/>
						<quer:string>2</quer:string>
					</quer:equal>
				</quer:filtering>
			</quer:filterings>
		</quer:query>
	</quer:includedIn>
</quer:filtering>