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: 
Not applicable

Where exists

Hi All

I am having two tables

Table A: PRODUCT, CATEGORY

Table B: PRODUCT, CATEGORY, Sales

I want to choose only product category from Table B that exist in Table A

i am currently Using Where Exist (PRODUCT) and Exist (CATEGORY)

but not working properly

Please Suggest

Labels (1)
10 Replies
maxgro
MVP
MVP

make a new field with product and category  (PRODUCT & '|' & 'CATEGORY as NewField)

use that field in where exists(NewField, PRODUCT & '|' & 'CATEGORY)

Not applicable
Author

HI Massimo

Thank You

But CATEGORY is a drill down group of PRODUCT

is it [ where exists(NewField, PRODUCT & '|' & 'CATEGORY)  ] possible

Not applicable
Author

Can you check the attachment

Not applicable
Author

Hi ,

You can just use:

WHERE Exists(PRODUCT,CATEGORY);

I think this could help.

Khushboo

Not applicable
Author

Hi Khushboo

I tried that way first in my data set and its not working as expected,

Not applicable
Author

Try this load script:

A:

LOAD PRODUCT,

     CATEGORY,

     Right(CATEGORY,3) as ProductKey

FROM

C:\QlikPrj\test\Book1.xlsx

(ooxml, embedded labels, table is Sheet1);

B:

LOAD PRODUCT,

     CATEGORY,

     SALES

FROM

C:\QlikPrj\test\Book1.xlsx

(ooxml, embedded labels, table is Sheet2)

WHERE Exists(ProductKey,PRODUCT);

DROP TABLE A;

Not applicable
Author

HI Gennaro

Thank you

But not the expected result

Not applicable
Author

Hi John,

Try this script that checks for the existence of the product and category.
I saw in the data categories in the two spreadsheets are reversed ie:
sheet1 = CATEGORY + PRODUCT
Sheet2 = PRODUCT + CATEGORY


A:

LOAD PRODUCT,

     CATEGORY,

     PRODUCT as ProductKey,

     Left(CATEGORY,Len(CATEGORY)-3) as CategoryKey

FROM

C:\QlikPrj\test\Book1.xlsx

(ooxml, embedded labels, table is Sheet1);

B:

LOAD PRODUCT,

     CATEGORY,

     SALES

FROM

C:\QlikPrj\test\Book1.xlsx

(ooxml, embedded labels, table is Sheet2)

WHERE Exists(ProductKey,PRODUCT) and Exists(CategoryKey,Right(CATEGORY,Len(CATEGORY)-LEN(PRODUCT)));

DROP TABLE A;

qlikviewwizard
Master II
Master II

Hi,

Try like this:

WHERE Exists(PRODUCT,CATEGORY);