AutoNumber() can be a pain when trying to debug problems in a QV data model, especially if you are integrating multiple data sources and need the original source’s keys to trace problems. Sometimes I get the impression that people recommend it based on the idea it will make the links between tables more efficient because numbers are more efficient key fields than strings, but given that all data whether a string or a number value is assigned a binary record pointer automatically, QlikView makes links between tables using those same binary addresses.
Autonumber() does nothing more than slim down the RAM QlikView uses by reducing the size of the symbol table that contains the unique values of a field. Therefore, it makes no sense to transform an ID with autonumber() for a key field and also keep the ID in its original state in another column. The only exception to this rule is when the original ID is used as a dimension or in an expression.
I started doubting the function’s benefits during performance tests of a 5,000,000,000-row / 30-field data model when I saw no change in the data model’s response time with or without using autonumber(). Recently, I optimized a QlikView application that had a file size of 1 GB and reduced it to 400 MB. As part of the process to renovate the data model, I removed the autonumber() functions from the key fields. I even had the pleasure to witness a nested autonumber() in a key field that was made out of two other key fields also generated by autonumber().
In the end and since the creation of the data model involved a unstable data integration and facts could contain keys that have no pair, I didn’t apply the autonumber() and left the key field with its original values so that it would be easier to trace the missing data at the source. As was the case for this data model, removing unused fields discovered using Rob Wunderlich’s Document Analyzer and link tables (a structure I haven’t used for years) are more effective techniques to optimize a data model than using the autonumber() for key fields.
With that said, if you have a key field that contains a large number of unique values that happen to be long strings, autonumber() will help reduce the RAM used by QlikView, but otherwise I don’t see any reason to over program a QlikView script and litter it with autonumber() functions.
Karl
Leave a reply to George Beaton Cancel reply