Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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?
Can you please check, If variable reading properly or not using KPI object? If so, Please provide an image
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.
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
try to find a WHERE statement that do work. Then create your variables.
What about the trigger part?
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)
AssureeService - Qlik Sense Extension Reload Button (Link)