I have built a QlikView script generator (QVS), that can be used to generate large script files for data imports from SQL Server to QlikView.
QlikView does not like ‘fully’ normalised database structures (loops between several tables): for example, three tables A
, B
, C
in SQL Server could have three PK/FK links; in QlikView it requires just two. So, I now have to ‘denormalize’, or remove the loops between tables…
Currently I am creating an ‘exclusion table’, which I traverse with an quad-imbedded for-loop, to isolate and remove constraints in the DB structure before generating the script file. This seems to work, but takes WAY too long as the number of tables can be large.
Is there another way that I can achieve what I want more economically?
2
Standard algorithm for denormalization:
-
Let’s take that rows of A,B,C tables are linked in mn:n:1 proportion.
-
Make three inserted cycles by each C by each appropriate B by each appropriate A.
-
For each row in the inner cycle make a new row of the result table.