Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

question about 'exists' function

Hi,

My task is to load the data on the Brands which exist in 2013. If a certain Brand existed in 2012, but doesn't exist in 2013, I want it to be excluded. I'm trying the following syntax. But it doesn't give the needed result - brands which existed only in 2012 are not excluded. Could you please help?

Source:

LOAD Brand,

          Month,

          [Media type],

          Year

FROM

C:\Users\Larisa.Filonova\Desktop\brand_data.xlsx

(ooxml, embedded labels, table is Лист1)

where Year = 2013

;

Concatenate (Source)

LOAD *

FROM

C:\Users\Larisa.Filonova\Desktop\brand_data.xlsx

(ooxml, embedded labels, table is Лист1)

where Year = 2012 and exists(Brand)

;

Thank you in advance,

Larisa

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Sure, load Brand temporarily as another field too:

Source:

LOAD Brand,

          Brand as LookUpBrand,

          Month,

          [Media type],

          Year

FROM

C:\Users\Larisa.Filonova\Desktop\brand_data.xlsx

(ooxml, embedded labels, table is Лист1)

where Year = 2013

;

Concatenate (Source)

LOAD *

FROM

C:\Users\Larisa.Filonova\Desktop\brand_data.xlsx

(ooxml, embedded labels, table is Лист1)

where Year = 2012 and exists(LookUpBrand, Brand)

;

DROP FIELD LookUpBrand;


talk is cheap, supply exceeds demand

View solution in original post

4 Replies
Gysbert_Wassenaar

Looks ok to me. Did you earlier in the script load another table that also contains a field named Brand?


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

Yes, I did. Is there a solution then?

Gysbert_Wassenaar

Sure, load Brand temporarily as another field too:

Source:

LOAD Brand,

          Brand as LookUpBrand,

          Month,

          [Media type],

          Year

FROM

C:\Users\Larisa.Filonova\Desktop\brand_data.xlsx

(ooxml, embedded labels, table is Лист1)

where Year = 2013

;

Concatenate (Source)

LOAD *

FROM

C:\Users\Larisa.Filonova\Desktop\brand_data.xlsx

(ooxml, embedded labels, table is Лист1)

where Year = 2012 and exists(LookUpBrand, Brand)

;

DROP FIELD LookUpBrand;


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

It works. Thank you!