Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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;
Looks ok to me. Did you earlier in the script load another table that also contains a field named Brand?
Yes, I did. Is there a solution then?
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;
It works. Thank you!