Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

aaroncouran
Contributor III

Link Table Multiplication

We have 2 tables connected by a link table.  This link table conencts many tables together in the data model.  The problem is that if I multiply a single key in one table by a single keyed value in another table, my result is then further multiplied by the number of total keys of that combination in the link table.

Please open my app and take a look at what I mean (heavily simplified for example sake).

I am looking to achieve an answer of 16 (2x8) but because there is a third key in the link table that duplicates the other two keys, I end up with an incorrect answer of 32.

I have used link tables for a long time and never realized this until now.  What am I doing wrong???

Tags (1)
1 Reply
aaroncouran
Contributor III

Re: Link Table Multiplication

I am finding that using the word DISTINCT solves this issue.  Not sure if there is data model solution for this kind of issue.  I know distinct is expensive expression.

Community Browser