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: 
deep2021
Creator III
Creator III

comparison date field is blank in qlik incremental load

Hi All,

 

In the incremental load for the insert logic my date field is showing as a blank.

Below is the piece of code for this.

$(IncrTimestampAttr) >=to_date('$(vL.Last_Exec_$(TableName))', 'YYYY-MM-DD HH:MI:SS')
AND
$(IncrTimestampAttr) <to_date('$(vL.This_Exec_$(TableName))', 'YYYY-MM-DD HH:MI:SS')

I am passing update date to the variable IncrTimestampAttr. 

 

Do i need to use peek to retrieve for the max value for the variable IncrTimestampAttr.

Can you please suggest in this.

Thanks,

 

 

 

4 Replies
avinashelite

I feel this statement is wrong 

$(IncrTimestampAttr) >=to_date('$(vL.Last_Exec_$(TableName))', 'YYYY-MM-DD HH:MI:SS')
AND
$(IncrTimestampAttr) <to_date('$(vL.This_Exec_$(TableName))', 'YYYY-MM-DD HH:MI:SS')

 

1. How your assigning the variable IncrTimestampAttr

2. For incremental the you need to compare the table field with variable like  below 

Data_base_Field_name >=$(IncrTimestampAttr) etc.......

 

 

 

deep2021
Creator III
Creator III
Author

Hi Avinash,

 

We are using the Update Date and we are storing the same Update Date in the  variable $(IncrTimestampAttr).

 

Thanks

avinashelite

Okay for the incremental you need to compare the data base field with variable, not the variable with data base field .

Share the code how your defining the variable 

$(IncrTimestampAttr)

share your code/script will help you out 

deep2021
Creator III
Creator III
Author

Hi Avinash,

PFB code,

IF wildmatch('$(vEntityType)','*DB*','*SQL*','*ORACLE*','*SYBASE*','*ACCESS*') THEN
IF (ISNULL(QvdCreateTime('$(vQVD_Extract)$(QVDName).QVD')) OR (QvdNoOfRecords ('$(vQVD_Extract)$(QVDName).QVD') = 0) OR ($(LoadTypeInput) = 0)) OR $(vL.Full_Load_Time) THEN
[$(TableName)]:
SQL SELECT
$(Columns)
FROM $(TableName)
Where $(WhereCond)
;
LET vL.Load_Type = 'FULL';
ELSE
[$(TableName)]:
SQL SELECT
$(Columns)
FROM $(TableName)
where
$(WhereCond)
AND
// $(IncrTimestampAttr) >= TO_DATE('$(vL.Last_Exec_$(TableName))')
// AND
// $(IncrTimestampAttr) < TO_DATE('$(vL.This_Exec_$(TableName))')
$(IncrTimestampAttr) >=to_date('$(vL.Last_Exec_$(TableName))', 'YYYY-MM-DD HH:MI:SS')
AND
$(IncrTimestampAttr) <to_date('$(vL.This_Exec_$(TableName))', 'YYYY-MM-DD HH:MI:SS')
;
EXIT SCRIPT;
//*;

We are storing all the value for variables, column names, Table names in the excel.

Thanks.