Of course yes, the easiest way is to customizing your km with a "WITH OPTION".
I'd suggest to follow this article
But the better way is to use a subselect as explained here
I know that this is an old thread, but did you manage to accomplish this?
I tried to dig the IKMs and ODI substitution, but from what I understand the "odiRef.getFrom()" method deals with the sources that are marked as subselect, and there is no way to break this subselects away from the "FROM clause" to use them in a "WITH clause".
Does any one have other thoughts?