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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
martynlloyd
Partner - Creator III
Partner - Creator III

Build master key

Hi,

I have two tables:

PRODUCT

100

200

300

OPTIONS

A

B

C

D

E

F

I need to build a key to identify unique configurations - e.g

100_ADEF

100_BCDEF

200_DEF

200_BDEF

I have a few thousand products, and each one has between 100 and 200 options.

What would be a good way to do this?

Regards,

Marty.

Labels (1)
1 Reply
swuehl
Champion III
Champion III

How are the OPTIONS linked to your PRODUCT?

Or, asking in other words, how do you derive your unique configurations from the two tables?

I am absolutely unsure what you are trying to achieve. Have you considered using a link table between PRODUCT and OPTIONS table, i.e for a configuration like 100_ADEF, you would built a link table like

LOAD CONFIG,

  PRODUCT,

  Mid(CONFIG, LEN1+iterno(),1) as OPTION

WHILE iterno()<= LEN2;

LOAD *, Subfield(CONFIG,'_',1) as PRODUCT, Len(Subfield(CONFIG,'_',1))+1 as LEN1, Len(Subfield(CONFIG,'_',2)) as LEN2 INLINE [

CONFIG

100_ADEF

100_BCDEF

200_DEF

200_BDEF

];