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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Load/Create Missing Values

Hi All,

I have two resident tables

[SLAES] and [PRODUCT]

The product table is missing few items. I would like to add some dummy records and call them unknown as shown in new [PRODDUCT] table

QlikView_Missing Prod.PNG

whatI tried to do was

left join(PRODUCT)

load PRODUCT_ID, 'UNKNOWN' as NAME resident [Sales] where /* Need help here */ NOT exists (PROD_ID) in [PRODUCT] Table

How do I do this?

Thanks,

Aji Paul.

1 Solution

Accepted Solutions
hic
Former Employee
Former Employee

Sales:

Load PROD_ID, ... from Sales;

Products:

Load PROD_ID, PROD_ID as PROD_ID2, NAME from Product;

Concatenate (Products)

Load distinct PROD_ID, 'UNKNOWN' as NAME

          Resident Sales

          Where not Exists(PROD_ID2, PROD_ID);

HIC

View solution in original post

3 Replies
Not applicable
Author

Here is a workaround I have , but very complex unnecessarily .

Experts would you please review and suggest and alternative?

[Sales]:
load * inline
[ITM_ID,PROD_ID,QTY,AMT
12,P12,1,20
13,P15,2,70
14,P98,3,30]
;

[PRODUCT_TEMP]:
load * inline
[PROD_ID,NAME
P12,Book
P15,DVD
p75,CD]
;


[PRODUCT_TEMP2]:
NoConcatenate Load DISTINCT PROD_ID
Resident Sales;
join(PRODUCT_TEMP2)
load PROD_ID, NAME
resident PRODUCT_TEMP;

drop table PRODUCT_TEMP;


[Product]:
NoConcatenate load PROD_ID, if(isnull(NAME), 'UNKNOWN', NAME) as NAME
Resident PRODUCT_TEMP2;

drop table PRODUCT_TEMP2;

hic
Former Employee
Former Employee

Sales:

Load PROD_ID, ... from Sales;

Products:

Load PROD_ID, PROD_ID as PROD_ID2, NAME from Product;

Concatenate (Products)

Load distinct PROD_ID, 'UNKNOWN' as NAME

          Resident Sales

          Where not Exists(PROD_ID2, PROD_ID);

HIC

Not applicable
Author

Thank you HIC