Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello all,
at the moment, I'm dealing with an importscript problem with QlikView 9SR5. In this script, I'm importing records (key is ITEM_ID) from a database. This record excists of several fields:
Articles:
LOAD
"ITEM_ID",
"ITEM_CODE" AS ArticleNumber,
"ITEM_REV" AS ArticleRevision,
"ITEM_GROUP" AS ArticleGroup,
"ITEM_DESC1" AS ArticleDescription1,
"ITEM_DESC2" AS ArticleDescription2,
"ITEM_DESC5" AS ArticleDescription5,
"ITEM_CURRENT" AS ArticleCurrent,
applymap('Temp_Preferred_Excel',ITEM_ID) AS ArticlePreferredFromExcel;
SQL SELECT *
FROM MST."MST_ITEM_MAIN";
So far, so good. After this, I'm importing the attributes for the 'Articles' from a different table (structure: ITEM_ID, HEADER_CODE, TECH_VALUE).
ArticleAttributes:
LOAD
"ITEM_ID",
if("HEADER_CODE" = 'COLOR', "TECH_VALUE") AS ArticleAttributeColor,
if("HEADER_CODE" = 'CURRENT', "TECH_VALUE") AS ArticleAttributeCurrent,
if("HEADER_CODE" = 'DIAMETER', "TECH_VALUE") AS ArticleAttributeDiameter,
if("HEADER_CODE" = 'HEIGHT', "TECH_VALUE") AS ArticleAttributeHeight,
if("HEADER_CODE" = 'LENGTH', "TECH_VALUE") AS ArticleAttributeLenght,
if("HEADER_CODE" = 'POWER', "TECH_VALUE") AS ArticleAttributePower,
if("HEADER_CODE" = 'PREFPART', "TECH_VALUE") AS ArticleAttributePrefpart,
if("HEADER_CODE" = 'RESISTANCE', "TECH_VALUE") AS ArticleAttributeResistance,
if("HEADER_CODE" = 'ROHS', "TECH_VALUE") AS ArticleAttributeRohs,
if("HEADER_CODE" = 'VOLTAGE', "TECH_VALUE") AS ArticleAttributeVoltage,
if("HEADER_CODE" = 'WIDTH', "TECH_VALUE") AS ArticleAttributeWidth;
SQL SELECT *
FROM MST."MST_ITEM_DATA";
Now, I would like to couple this table to the first table so the structure is:
ITEM_ID, ITEM_CODE, ... , ArticlePreferredFromExcel, ArticleAttributeColor, ... ArticleAttributeWidth.
I tried using a LEFT JOIN to do this:
LEFT JOIN (Articles)
LOAD *
RESIDENT ArticleAttributes;
DROP TABLE ArticleAttributes;
But this won't give me the result I want. Because it has to be possible to have multiple attributes to a single ITEM_CODE. At the moment, every ITEM_CODE has only one attribute. So it's not possible to make a multiple attribute selection in a multibox (for example).
Am I making a bad join or do I have to change the code in 'ArticleAttributes'?
Kind regards,
Martijn te Molder
Did you try only JOIN (TABLENAME) instead of left join?
This didn't solve my problem, I still got 600K+ MST_ITEM_DATA items and 40K MST_ITEM_MAIN items. The MST_ITEM_DATA items have to be coupled to the MST_ITEM_MAIN items.