I want to do incremental data load process in qlikview and store the data into qvd and source of data is hive.

I am following the below approach for delta load,

Get the latest modified date from QVD and save it in a variable ex: Modifieddate.

Get records from Hive whose modified date is greater than Modifieddate,i am using where condition

Get new records from Hive whose primary key not exist in QVD.

Loading the fetched records from hive to qvd.

4.1. If the primary key already exist, update the record

4.2. If the primary key doesn’t exist, insert the record

the issue i am facing here is the hive query is not able to fetch records from according to the where condition,I have checked the same query from hive CLI it is working fine and I have checked static query from Qlikview to hive it is also working fine. The issue is occurring when I am using variable substitution in query.