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

Data load, timestamp variable

Hi community,

I am trying to load data based on timestamp variables. The goal is to load data between fromdate and todate.
For this I have tries the following:

SQL SELECT SAMPLED,
RESOURCE_NAME,
RATE
FROM Table_A
where SAMPLED>'$(vFromDate)' AND SAMPLED<'$(vToDate )';

SAMPLED contains data like (11/11/2019 12:00:00 AM)

I have declared todate and fromdate as:
Let vFromDate=timestamp(timestamp#('08/10/2019 00:00:00 AM', 'M/D/YYYY h:mm:ss'));
Let vToDate=timestamp(timestamp#('08/15/2019 00:00:00 AM', 'M/D/YYYY h:mm:ss TT'));

However data are not loaded:Lines fetched: 0

Any ideas?

One more question: Is it possible to trigger data load from application sheet?

6 Replies
Anil_Babu_Samineni

Can you please check, If variable reading properly or not using KPI object? If so, Please provide an image

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Vegar
MVP
MVP

My first step in trouble shooting  variables is to skip the variables.

Take a look at you variables in the Qlik Sense variable overview, does it look as expected?

If YES, copy the variable value and replace your variables in the script with that value in order to see if you get the desired query result. 

So I would try to run something like this:

SQL SELECT SAMPLED,
RESOURCE_NAME,
RATE
FROM Table_A
where
SAMPLED>'08/10/2019 00:00:00' AND SAMPLED<'08/15/2019 12:00:00 AM';

I notice that you define your variables as vFromData and vToDate, but in the script sample they are named fromdate and todate, make sure that your references are correct.  I also notice that you have two different format definition for your vFromDate and vToDate, with and without the TT. 

nikolis_gr
Contributor III
Contributor III
Author

Well,

variables are NULL , this is not working at all:

"SAMPLED>'08/10/2019 00:00:00' AND SAMPLED='08/15/2019 12:00:00 AM';"

and I am not using KPI object

Vegar
MVP
MVP

try to find a WHERE statement that do work. Then create your variables.

nikolis_gr
Contributor III
Contributor III
Author

What about the trigger part?

Vegar
MVP
MVP

You can trigger an reload using the Qlik Sense engine API. You could try to create something your self through the dev-hub or implement one of the many open source extensions available on GitHub. Such as the two examples below.

emark - ReloadTaskButton (Link)

EMARK_Reload_Task

AssureeService - Qlik Sense Extension Reload Button (Link)

40842356-a16911dc-657b-11e8-86c6-2c4096638032