I think you want apply a SQL logic on a qlikview datamodel. Quite often is this heavily complicating. You need only to avoid circular references and if possible synthetic keys and then it's quite easy. See here what is meant: Get started with developing qlik datamodels.