Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
LauraMorris
Contributor III
Contributor III

Incremental load into qvd with aliased columns

I need to do an incremental load to speed up qvd creation. My problem is that the qvd I am adding to has aliased fields which it is then not concatenating into, it says it cant find HistoryID which is true as it has been renamed to $_historyid.

[statushistory]:

SQL SELECT HistoryID,
HistoryType,
HistoryRefID,
HistoryStatusID,
HistoryDateTime,
HistoryUserID,
HistorySubStatus
FROM Reports\stathist
WHERE HistoryDateTime > '$(vToday1)';

CONCATENATE LOAD HistoryID AS $_historyid,
HistoryType AS historytype,
HistoryRefID AS $_serviceid,
HistoryStatusID AS $_historystatusid,
HistoryDateTime AS historydatetime,
DATE(FLOOR(HistoryDateTime))AS historydate,
YEAR(FLOOR(HistoryDateTime))AS historyyear,
MONTH(FLOOR(HistoryDateTime))AS historymonth,
DAY(FLOOR(HistoryDateTime))AS historyday,
HistoryUserID AS historyuserid,
HistorySubStatus AS historysubstatus,
HistoryStatusID&'-'&HistorySubStatus AS $_historyfullstatus

from [lib://....\statushistory.qvd];

Store * From [statushistory] into [lib://...\statushistory.qvd];
Drop Table [statushistory];

Labels (1)
1 Reply
fkeuroglian
Partner - Master
Partner - Master

Hi, try this

[statushistory]:

SQL SELECT 

HistoryID AS $_historyid,
HistoryType,
HistoryRefID,
HistoryStatusID,
HistoryDateTime,
HistoryUserID,
HistorySubStatus
FROM Reports\stathist
WHERE HistoryDateTime > '$(vToday1)';

CONCATENATE

LOAD

$_historyid,

HistoryType AS historytype,
HistoryRefID AS $_serviceid,
HistoryStatusID AS $_historystatusid,
HistoryDateTime AS historydatetime,
DATE(FLOOR(HistoryDateTime))AS historydate,
YEAR(FLOOR(HistoryDateTime))AS historyyear,
MONTH(FLOOR(HistoryDateTime))AS historymonth,
DAY(FLOOR(HistoryDateTime))AS historyday,
HistoryUserID AS historyuserid,
HistorySubStatus AS historysubstatus,
HistoryStatusID&'-'&HistorySubStatus AS $_historyfullstatus

from [lib://....\statushistory.qvd];

Store * From [statushistory] into [lib://...\statushistory.qvd];
Drop Table [statushistory];