If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.
Hi,
I want to load data where expiration date is greater than today, when i load script it doesnt filter data above expiration date greater than today(). Below shows all data.
in my databse i have date in this format 2015-02-11 23:59:59
let varExpirationDate = Timestamp(Today(),'MM-DD-YYYY hh:mm:ss');
LOAD `campaign_id`,
`campaign_group_id`,
`start_date`,
expiration_date;
SQL SELECT `campaign_id`,
`start_date`,
`campaign_group_id`,
expiration_date,
FROM rcdb.CAMPAIGN where expiration_date >= '$(varExpirationDate)';
what am i missing?
Hi Supriya,
See the Date format.
databse format 2015-02-11 23:59:59
let varExpirationDate = Timestamp(Today(),'MM-DD-YYYY hh:mm:ss');
The variable Should be :
let varExpirationDate = Timestamp(Today(),'YYYY-MM-DD hh:mm:ss');
Hope this helps.
May be try this:
LOAD `campaign_id`,
`campaign_group_id`,
`start_date`,
expiration_date;
SQL SELECT `campaign_id`,
`start_date`,
`campaign_group_id`,
expiration_date,
FROM rcdb.CAMPAIGN where expiration_date >= SYSDATE;
Hi,
What is SYSDATE here?
system date which should be similar to Today()
It is system date (syntax)
SYSDATE returns the current date and time set for the operating system on which the database resides.
This is giving me error when i am loading in script using SYSDATE
Can you run this query in TOAD or any other tool that you might use to run your queries outside of QlikView
SQL SELECT `campaign_id`,
`start_date`,
`campaign_group_id`,
expiration_date,
FROM rcdb.CAMPAIGN where expiration_date >= SYSDATE;
If data is less, can you try like below !!
let varExpirationDate = Timestamp(Today(),'MM-DD-YYYY hh:mm:ss');
LOAD `campaign_id`,
`campaign_group_id`,
`start_date`,
expiration_date
where expiration_date >= '$(varExpirationDate)';
SQL SELECT `campaign_id`,
`start_date`,
`campaign_group_id`,
expiration_date,
FROM rcdb.CAMPAIGN;
Below query is working
LOAD `campaign_id`,
`campaign_group_id`,
`start_date`,
expiration_date;
SQL SELECT `campaign_id`,
`start_date`,
`campaign_group_id`,
expiration_date
FROM rcdb.CAMPAIGN where expiration_date >= SYSDATE();
Trace($(=SYSDATE()));
but trace is not showing date ?