Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear Qlikview user
I have obtained the Maximum Year in the load script by using a resident load
MinMaxDates:
Load
Max(Yearname(FactDate, 0, 4)) as MaxYear
Resident Table 1;
I now wish to link this MaxYear within Table2 in my script, so I can place a filter in the where clause and only retrieve the Max Year
I.e. (Next Table)
main_data:
LOAD
Count,
Unique_ID,
data_source,
FactDate,
FactDateNum
Resident Table1
WHERE ???????????????
DROP Table1;
Could someone kindly advise on how I would achieve this?
Kind Regards
Helen
Hi,
use where exist() for details see in help menu
try like
Load * from table where exist(maxYear,comparingField);
Regards
I guess to get the exact script, you might need this:
main_data:
LOAD Count,
Unique_ID,
data_source,
FactDate,
FactDateNum
Resident Table1
WHERE Exists(MaxYear, YearName(FactDate, 0, 4));
DROP Table1;
Alternatively, you can also do this:
Table1:
LOAD *,
Year(FactDate) as FactYear
FROM Source;
Right Join (Table1)
LOAD Max(FactYear) as FactYear
Resident Table1;