Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Mapping codes between tables

I have two database tables. The first one contains about 12-15 fields that are codes. The second table contains information about the codes like text to assoicate with it. The second table has about 10 fields.

How do I map these to each other? If I had one code field it would be easy, just rename the code field in the first table to the field containing the code in the 2nd table.

Any thoughts,

Joe Toeniskoetter

2 Replies
johnw
Champion III
Champion III

Well, there are several ways, though none will give you a particularly simple script. Let's say that each code means something different, like the first code is a customer ID, the second code is a color ID, the third code is a product type ID, and so on. In that case, you could create 10-15 copies of your codes table, each with a different name for every field (customer code, customer name, color code, color name, etc.), and only including the relevant codes.

To simplify your data model, using those same field names, you could merge the 10-15 copies of your codes table with your main table, and rely on QlikView's compression to keep it from taking too much memory.

But let's say the 10-15 codes are really just an array in the main table, like a list of every defect in a manufactured item. You could normalize the data into a main table with a record ID but no codes, a table with a separate row for each code for each record ID, and then your code table with the descriptions and other data.

I can think of other ways of assembling the data as well. It all depends on what your data represents, and how you want to display and interact with it. Just saying you have 10-15 codes isn't enough for me to make recommendations. But maybe one of the options above will be what you need.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Could you post some example data? There are features like Generic tables and CrossTable load that may be useful, but hard to tell without seeing a sample.

-Rob