Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
poluvidyasagar
Creator II
Creator II

Loading error with same column name from QVD using Where Clause

Hi,

I have 2 qvd files with date column in it and trying to use the following logic for my incremental load problem. I am trying to load the data from both the qvds with where clause like below:

So I begin with setting my current todaysweek to WeekToday variable

LET WeekToday= Year(today()) & Num(Week(today()),'00')

Now I load the data from Table1 like below.  Trying to load anything not equal to current week data. The first table works fine.

Table1:

LOAD Date, A, B
FROM [$(vL.QVDFolder)Table1.qvd](qvd)
Where Year(Max(Date)) & Num(Week(Max(Date)),'00') <> '$(WeekToday)';

Now I am trying to load table 2 just like above from qvd with the same logic. But this time Table2  has Date column and 2 different columns C, D. Both tables are entirely different so I dont want to concatenate and also I do not want to use qualify statement.

Table2:
LOAD Date, C,D
FROM [$(vL.QVDFolder)Table2.qvd](qvd)
where Year(Max(Date)) & Num(Week(Max(Date)),'00') <> '$(WeekToday)';

This time I am getting an error saying :

"Unknown LOAD statment error
Table2:
LOAD Date, C,D
FROM [..\2.QVD\ManageLocationHistory.qvd](qvd)
where Year(Max(Date)) & Num(Week(Max(Date)),'00') <> '$(WeekToday)'"

Is it a problem to load data from 2 qvds with same date column field and use them as where clause.

Thanks,
Vidya

 

Labels (1)
11 Replies
poluvidyasagar
Creator II
Creator II
Author

yes you are right..I do not need Max since it is a row by row comparison.

 

Thank you

Vegar
MVP
MVP

Yes Year(Date) will only work if you have one value. In a chart object you will normally use max() because you are comparing multiple values, but when loading a qvd you are comparing one row at the time. So when reading a qvd without using GROUP BY you should use Year(Date) not year(max(Date)).